I have here two applications in two different projects in eclipse. One application (A) defines an activity (A1) which is started first. Then i start from this activity the s
what ever action we are passing inside in android, we have to use same action while creating Intent object or setAction() method of Intent. when we will send this Intent object with the help of sendBroadcasteReceiver() method of Context then it will send this action to all receiver(without permission), what ever receiver we have set in Manifest.xml all will(who has same action in intent-filter tag) get this action.
Though the answers are helpful I still had the a problem. I got the solution here.
when sending the broadcast add the ff flag:
FLAG_INCLUDE_STOPPED_PACKAGES flag is added to the intent before it is sent to indicate that the intent is to be allowed to start a component of a stopped application.
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
<receiver>
element needs to be a peer of your <activity>
element, not a child.android.intent.action
namespace, unless you work for Google -- use ch.ifi.csg.games4blue.games.pacman.controller.BROADCAST
or something like that instead<intent-filter>
with your custom action needs to be placed on the <receiver>
, not the sending or receiving <activity>
See here for an example of implementing a manifest-registered broadcast receiver (for a system-broadcast Intent).
Intent intent = new Intent("pacman.intent.action.BROADCAST");
vs.
<android:name="android.intent.action.BROADCAST"/>
Are you sure you use the same string in real code?