android - Why is category HOME required? -
this question has answer here:
i have these categories defined in application manifest file:
<intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.home"/> <category android:name="android.intent.category.launcher" /> </intent-filter>
if remove line -
<category android:name="android.intent.category.home"/>
it not affect part of application functionality , can see application in home screen launcher list of android device.
however, if remove last line -
<category android:name="android.intent.category.launcher" />
i see change application gets disappeared home screen launcher list of android device.
so question what's purpose of category home , what's common use.
if purpose of category launch home screen mentioned in android docs, can following also:
intent homeintent= new intent(intent.action_main); homeintent.addcategory(intent.category_home); homeintent.setflags(intent.flag_activity_new_task); startactivity(homeintent);
<category android:name="android.intent.category.home"/>
indicates when press home button, app listed option launch launcher home or home activity (along applications have category in manifest activity). more simple, whenever press home button, applications installed in phone have category.home category , action_main in intent-filter in androidmanifest.xml listed (unless have chosen application default) in chooser user select home want launch.
Comments
Post a Comment