Do not add anything in the config file
Broadcast registration can be written in activity (onCreate) or in fragment (onactivitycreated).
Localbroadcastmanager Broadcastmanager =Localbroadcastmanager.getinstance (Getactivity ()); Intentfilter Intentfilter =NewIntentfilter (); Intentfilter.addaction ("Android.intent.action.CART_BROADCAST");//It is recommended to write a public variable, which is easy to read and will not be written. Broadcastreceiver Mitemviewlistclickreceiver =NewBroadcastreceiver () {@Overridepublic void onreceive (context context, Intent Intent) {System.out.println ("OK");}}; Broadcastmanager.registerreceiver (Mitemviewlistclickreceiver, intentfilter);
Send broadcast
New Intent ("Android.intent.action.CART_BROADCAST"); Localbroadcastmanager.getinstance (Getactivity ()). Sendbroadcast (intent);
Android registered broadcast code (standby)