Dear all,

I’m developing an application with uses AsyncTask. In the
doInBackground() method I register a BroadcastReceiver and when the
task is finished I unregister it.

The problem appears when the screen orientation changes in the middle
of the execution, as the task is not finished the BroadcastReceiver is
not ungistered and, therefore, I get this exception (after registering
again the BroadcastReceiver):

android.app.IntentReceiverLeaked: Activity myActivity has leaked
IntentReceiver  myActivity $WifiReceiver@40530508 that was originally
registered here. Are you missing a call to unregisterReceiver()?

Do you know any way to be aware of this change and unregister the
BroadcastReceiver before the new AsyncTask is executed on onResume ()?

Thank you,

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to