0

I am new to the android as a programmer.In the android manifest file we have the code as:

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

Question

Why do we need to specify the category LAUNCHER, when we have specified the action to be MAIN which is enough to tell the android that Class1 is going to be initial activity of my app?

J J
  • 165
  • 6

2 Answers2

1

ACTION_MAIN is required Action to be performed.It is the main or starting point and wont expect any data.

CATEGORY_LAUNCHER The activity is the initial activity of a task and is listed in the system's application launcher.

You could refer these links

http://developer.android.com/reference/android/content/Intent.html What is the meaning of android.intent.action.MAIN?

Community
  • 1
  • 1
Dominic D'Souza
  • 961
  • 2
  • 7
  • 16
0

"android.intent.category.LAUNCHER" means this activity will display an icon in the launcher home screen. Without this category , you can't see its icon in launcher home screen.

android.intent.action.MAIN means this activity is a entry point of your app.

zhibin
  • 59
  • 5