Launch Activity From Another Application Android
Solution 1:
What you need to use are intent-filters
. Assume the activity to be launched is in the package launch.me
. Inside this applications manifest all the activities (main or otherwise) will be decalred by the <activity>
tag.
Assuming the activity you want to launch is inside the class file Launchme
. Then a portion of your manifest will be something like:
<activityandroid:name="launch.me.Launchme"android:label="@string/app_name"><intent-filter><actionandroid:name="launch.me.action.LAUNCH_IT"/><categoryandroid:name="android.intent.category.DEFAULT"/></intent-filter></activity>
Now in the activity from where you want to launch the above activity use:(Note: This activity can be in any package anywhere. You have to make sure that both, the calling and the called packages are available on the device)
Intent i=newIntent();
i.setAction("launch.me.action.LAUNCH_IT");
startActivityForResult(i,0);
You can use other methods for starting the intent other than startActivityForResult
, thats upto you.
Solution 2:
Did you add activity inside app1
s manifest?:
<activityandroid:label="@string/app_name"android:name=".Identificar" ></activity>
Solution 3:
I think, since both activities are in the same package that you only have to do:
startActivity(newIntent(getApplicationContext(), Identificar.class));
Post a Comment for "Launch Activity From Another Application Android"