Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you know what the main launch Activity is?

Newb question. How can you know what the main launch Activity is? Learning Android.

like image 859
rotaercz Avatar asked Mar 29 '12 20:03

rotaercz


People also ask

How do I find my main activity?

This can be found in the application's manifest. The main activity is the activity with the intent-filter whose name is android. intent. action.

What is launch the application by main activity?

This is the default launch mode of activity (If not specified). It launches a new instance of an activity in the task from which it was launched. Numerous instances of the activity can be generated, and multiple instances of the activity can be assigned to the same or separate tasks.

How is activity launched?

Activity launch behavior is defined by launch modes in the AndroidManifest. xml files of apps, intent flags, and ActivityOptions provided by the caller. Use ActivityOption#setLaunchDisplayId(int) to target a specific display for activity launch. By default, the activity launches on the same display as the caller.

What is launcher activity?

Displays a list of all activities which can be performed for a given intent. Launches when clicked.


2 Answers

Assuming this is for your code, check out the manifest.xml and look for this element:

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

It should be contained within <Activity> ... </Activity> tags, and that Activity is the one that a user can launch from their phone.

like image 142
edthethird Avatar answered Sep 29 '22 11:09

edthethird


You have to put the right intent tag on the activity in the manifest:

    <activity android:name=".SomeActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
like image 30
mtmurdock Avatar answered Sep 29 '22 11:09

mtmurdock