发送
Intent intent = new Intent("android.intent.action.refresh"); intent.putExtra("refresh","lang"); intent.putExtra("keyi",mDefaultCommunity.uuid); LocalBroadcastManager.getInstance(App.mContext).sendBroadcast(intent);
当多个时可以通过传输数据的方式进行相应判断处理
接收
LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(getActivity()); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction("android.intent.action.refresh"); BroadcastReceiver mItemViewListClickReceiver2 = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String refresh = intent.getStringExtra("refresh"); if(refresh.equals("lang")){ String keyi = intent.getStringExtra("keyi"); //进行刷新 } } }; broadcastManager.registerReceiver(mItemViewListClickReceiver, intentFilter);