Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch Android Activity directly in Eclipse

During development, I want to create run configurations for several activities within my App, so that I can go directly to the Activity I want to test.

But when I create a new Run configuration the list corresponding to "Launch Action" contains only the MAIN Activity and not the others.

Following @sparkymats suggestion I tried adding an IntentFilter to AndroidManifest.xml (either empty or with a android.intent.category.LAUNCHER category), but the Activity list still only contains the MAIN Activity.

How can I directly launch other activities?

like image 701
Frank Harper Avatar asked Jul 26 '11 05:07

Frank Harper


2 Answers

In the Manifest file, put these lines inside each activity's tag that you want to lunch

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
like image 161
iTurki Avatar answered Sep 30 '22 15:09

iTurki


To achieve this, you will need to modify your AndroidManifest.xml and add an IntentFilter to each one you want to launch directly. An Activity is launched by sending an Intent to it. So, the Activity must be configured to receive Intents from the launcher.

like image 36
sparkymat Avatar answered Sep 30 '22 16:09

sparkymat