android - Dynmaic registration of BroadcastReceiver's actions (intent-filter) -
I have a broadcast receiver and a service in my application. I am receiving information about the action in the service from an activity. I have to dynamically register this action with the receiver. I have some actions defined in AndroidManifest.xml, but this action must be defined dynamically whether anyone can help me with it?
Thank you.
P.S. One sample receiver tag from AndroidManifest.xml is BOOT_COMPLETED one of the tasks I am referring to. I am receiving this information in this service You can use it:
IntentFilter intentFilter = new intent filter ("android.intent.action.BOOT_COMPLETED"); Your Receiver Receiver = New Your Receiver (); Local Broadcast Manager MBDactMGR = LocalBlockManager GetStation (getApplicationContext ()); MBroadcastMgr.registerReceiver (receiver, intent filter);
Comments
Post a Comment