How to use Broadcast Receiver in different Applications in Android?

后端 未结 4 2065
日久生厌
日久生厌 2020-11-29 09:04

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

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 09:39

    1. Your element needs to be a peer of your element, not a child.
    2. Your action string should NOT be in the android.intent.action namespace, unless you work for Google -- use ch.ifi.csg.games4blue.games.pacman.controller.BROADCAST or something like that instead
    3. Your with your custom action needs to be placed on the , not the sending or receiving

    See here for an example of implementing a manifest-registered broadcast receiver (for a system-broadcast Intent).

提交回复
热议问题