Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Info about Action MAIN and Category Launcher in Android Manifest

In the Android manifest file, what do you mean by the category Launcher and action MAIN
category android:name="android.intent.category.LAUNCHER"
action android:name="android.intent.action.MAIN"

Is it possible to make one activity the laucher and another one the main action?

like image 969
Waheed Khan Avatar asked Dec 22 '22 11:12

Waheed Khan


1 Answers

Extending the answer of Balaji, I'll add-up a few things:

For the starters, there could be multiple points of entry to an app. Let's suppose our app has two activities for simplicity.

You can keep the <intent-filter> tag in both activities and contain MAIN as well as LAUNCHER into it. This would create two launchers of the app - and two identical app icons could be physically seen at your app-launcher. You click on one icon - and it'll start one of the activities. You click the other, and it'll start the other activity.

However, if you drop either of MAIN or LAUNCHER tag from the the second activity, there'll be only one physical launcher for the app which launches the first activity.

Having said that, MAIN in an activity is used to tell that when the app starts, it'll start with this very activity.

like image 108
Akeshwar Jha Avatar answered Jan 18 '23 12:01

Akeshwar Jha