I am using BroadCast Receiver in my app. I have many activities in my app. Used broadcard receiver in MainActivity.java as below :
private BroadcastReceiver smsReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// Retrieves a map of extended data from the intent.
final Bundle bundle = intent.getExtras();
try {
if (bundle != null) {
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
I am notifying when message is coming and MyActivity is in focus. Now When my other activites are in focus i am not getting notified. Is there a common way to use BroadCast thing as global way ??? for all activities ???