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 & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt;

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

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -