1

So what I am is pretty simple, but I can't figure it out. I am trying to start another app using an intent and intent filter.

In my first app when a user clicks on a button I want it to start another activity in a separate app. This is the intent I am using in the first app with the button.

Intent notificationIntent = new Intent("foo");

In my second app I am trying to catch that intent by defining an Intent filter in the manifest like this:

   <activity
       android:name=".MainActivity"
       android:label="@string/app" >
       <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <action android:name="foo" />

         <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
   </activity>

Shouldn't the MainActivity catch the intent and start up? It doesnt seem to be working.

HAxxor
  • 1,094
  • 3
  • 15
  • 28

2 Answers2

0

If You want to open new app from your app then you have to provide package name to start

Hear is an example code

Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("your package name");
startActivity(LaunchIntent);`

`

J.D.
  • 1,364
  • 1
  • 11
  • 20
-1

To start new application with intent you provide entire package name with activity name. Refer THIS in that you can find the same.

Community
  • 1
  • 1
Hardik Joshi
  • 9,259
  • 11
  • 59
  • 110