I extend BroadcastReceiver, and in onReceive() I do whatever I need to do.
onReceive() has a timeout, from the documentation:
there is a timeout of 10 seconds that
the system allows before considering
the receiver to be blocked and a
candidate to be killed
This creates a problem when I am in debug mode. I need more than 10 seconds (sometimes). If I don’t do all my debugging in 10 seconds my connection is closed and debugging is stopped.
Can I increase the timeout or disable it for debugging purposes?
Thanks.
In order to prevent your app from force closing while you are paused on a break point during debugging, try installing the Dev Tools application and enable the Debug App setting which:
All of the details are here: http://developer.android.com/tools/debugging/debugging-devtools.html
If you are doing something complicated in your
onReceivemethod, then consider having yourBroadcastReceiverstart a Service and pass along the data it gets from withinonReceive. TheServicecan then do the longer processing.