Workaround solution.
If you worried,that is some bizzare cases yor receiver can be magically unregistered or you suffer from annoying bug with view/rotation crashes (Appear in Android 2.1-2.3.7) http://code.google.com/p/android/issues/detail?id=6191 (which is described in almost all forums for android developers or websites like stackoverflow ) ,then I suggest surrond unregister with try/catch IllegalArgumentException block
try {
if (receiver != null) {
this.unregisterReceiver(receiver);
}
} catch (IllegalArgumentException e) {
Log.i(TAG,"epicReciver is already unregistered");
receiver = null;
}
No comments:
Post a Comment