Start Activity from another Application


We want to start Notification Activity in FSB app from our app, To doing this we have two different solution:

1. By set component

Intent intent = new Intent();
intent.setComponent(new ComponentName("application-package-name","class-path"));

For example FSB application package name is “” and Notification Activity class path is “” so my ComponentName should be like this:

intent.setComponent(new ComponentName("",""));

2. By action name

You should add “intent-filter” for the target Activity (NotificationActivity) in “AndroidManifest.xml” like this:

<activity android:name=".features.main.NotificationActivity">
      <action android:name="action-name" />
      <category android:name="android.intent.category.DEFAULT" />

For action name you define, it’s best to use the package name as a prefix to ensure uniqueness. For example, a NOTIFICATION action might be specified as follows:

<action android:name=""/>

Intent should be like this:

Intent intent = new Intent("unique-action-name");
intent.putExtra("title", "my custom title");

You can get extra data in target activity like this:

protected void onNewIntent(Intent intent) {
   String title = intent.getStringExtra("title");

Note: Do not use onCreate method because if your activity’s launchMode was set to singleTop the onCreate method will not call if activity is already loaded in memory.