onresume:
LocalBroadcastManager.getInstance(HomeScreen.this).registerReceiver(receiver, new IntentFilter(BROADCAST_ACTION));
public static final String BROADCAST_ACTION = "NotifyInbox";
private BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
boolean notify = intent.getBooleanExtra("notify_count", false);
Log.e("notify_count ", "" + notify);
if (notify) {
mAdapterMenu.notifyDataSetChanged();
}
}
};
LocalBroadcastManager.getInstance(HomeScreen.this).unregisterReceiver(receiver);
LocalBroadcastManager.getInstance(HomeScreen.this).registerReceiver(receiver, new IntentFilter(BROADCAST_ACTION));
public static final String BROADCAST_ACTION = "NotifyInbox";
private BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
boolean notify = intent.getBooleanExtra("notify_count", false);
Log.e("notify_count ", "" + notify);
if (notify) {
mAdapterMenu.notifyDataSetChanged();
}
}
};
LocalBroadcastManager.getInstance(HomeScreen.this).unregisterReceiver(receiver);
No comments:
Post a Comment