I faced to one problem on android 4.0.3 (on 4.1.2 it works fine). I have in my Activity BroadcastReceiver. When I send a broadcast, method onReceive() called always twice. P
I have just had this problem and I found a solution that wasn't mentioned in any of the existed answers, so I would like to share it.
I register the BroadcastReceiver just once in onCreate
However, I was registering it like this:
LocalBroadcastManager.getInstance(this).registerReceiver(new MyBroadcastReceiver(), mStatusIntentFilter);
In other words, I was constructing the boradcastReceiver instance inside the registerReceiver call.
But when I construct the BroadcastReceiver in a separate statement the problem was solved. Like this:
MyBroadcastReceiver myBroadcastReceiver = new MyBroadcastReceiver();
LocalBroadcastManager.getInstance(this).registerReceiver(myBroadcastReceiver , mStatusIntentFilter);
Very weird workaround, maybe it's a bug that will be fixed later.