0

I have two applications which talk with each other via receiver. When a button is pressed in application A, I broadcast an Intent with a certain permission. Application B then wakes up makes some calculations and again broadcasts an Intent with a certain permission for application A. In both manifests I define the permission (same name) and I also register both receivers.

    <permission android:name="aa.bb.cc.dd"
    android:label="permission"
    android:protectionLevel="normal"></permission>

    <receiver android:name=".receiver"
        android:exported="true">

        <uses-permission android:name="aa.bb.cc.dd"/>

        <intent-filter>
            <action android:name= "a_certain_action"/>/>
        </intent-filter>
    </receiver>

and call them :

    Intent i = new Intent();
    i.setAction("a_certain_action");
    sendBroadcast(i,"aa.bb.cc.dd");

However while this worked perfect yesterday today the receiver on application B won't wake up when I broadcast the intent. Why is that?

Libathos
  • 3,340
  • 5
  • 36
  • 61

1 Answers1

1

Your app was probably killed, and receiver is unregistered then. Try to use service, and there register broadcast

Tomasz Czura
  • 2,414
  • 1
  • 14
  • 18