In my developer console people keep reporting an error that I cannot reproduce on any phone I have. One person left a message saying he gets it when they try to open the set
Lets assume your broadcastReceiver is defined like this:
private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// your code
}
};
If you are using LocalBroadcast in an Activity, then this is how you'll unregister:
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
If you are using LocalBroadcast in a Fragment, then this is how you'll unregister:
LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(broadcastReceiver);
If you are using normal broadcast in an Activity, then this is how you'll unregister:
unregisterReceiver(broadcastReceiver);
If you are using normal broadcast in a Fragment, then this is how you'll unregister:
getActivity().unregisterReceiver(broadcastReceiver);