I have my remote service which tries to run an activity from a different application this way:
Intent i = new Intent("ValidateActivity.intent.action.Launch");
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
Now also in the remote service app I’ve added in the manifest these lines:
<service android:name=".UdpListenerService">
<intent-filter>
<action android:name="com.something.IUdpListenerService" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</service>
Now in the target activity’s manifest(ValidateActivity) I’ve added these lines:
<activity android:name="com.something.ValidateActivity" >
<intent-filter>
<action android:name="ValidateActivity.intent.action.Launch"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
I should mention that the target activity is in a different apk, and it has two packages:
- com.something (there I have my ValidateActivity)
- com.test (there I have another activity, which is not relevant for this question).
Now after I try to run it, I still get the error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.external/com.something.ValidateActivity}: java.lang.NullPointerException
The problem was in the new activity, not in firing the intent.