Appendix A has this BroadcastReceiver in its manifest (inside <application>):
And this receiver:
public class RemoteControl extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.w(TAG, "Look what I did!");
}
}
I am trying to call this from application B:
public void onClick(View v) {
Log.w(TAG, "Sending stuff");
Intent i = new Intent("app.a.remotecontrol");
i.setData("http://test/url");
sendBroadcast(i);
}
For some reason, onReceive () in application A never starts, even if it is broadcast from application B. What could be the reason for this?
EDIT AND SOLUTION . I forgot to write that before the broadcast I used setData () in Intent. This is really a problem: as soon as I deleted setData (), the translation worked as intended.
source
share