什么是android.intent.action.MAIN意思?意思、intent、android、MAIN

2023-09-12 04:33:44 作者:用泪祭奠思念

我看到这么多不同的混乱explenations ..

 <意向滤光器>
     <作用机器人:名称=android.intent.action.MAIN/>
     <类机器人:名称=android.intent.category.LAUNCHER/>
&所述; /意图滤光器>
 

是什么意思

 <作用机器人:名称=android.intent.action.MAIN/>
 

 <类机器人:名称=android.intent.category.LAUNCHER/>
 
Android.intent.action.MAIN 与 android.intent.category.LAUNCHER 的验证理解

 <类机器人:名称=android.intent.category.DEFAULT/>
 

解决方案

android.intent.action.MAIN 表示,这项活动是应用程序的入口点,即当你启动应用程序,这项活动被创建。

从文档

  ACTION_MAIN与类别CATEGORY_HOME  - 启动主屏幕。
 

另外,从这里

  

活动开始行动为主要切入点,预计不会   接收数据。

android.intent.category.DEFAULT 主要用于隐含意图。如果您的活动希望通过一个隐含的意图来启动它应该包括这个catetory在其过滤器。 如果你的活动可能是由一个隐含的意图开始时,没有特定的类别分配给它,它的意图过滤器应包括这一类。

android.intent.category.LAUNCHER

  

类别 - 给出要执行的操作的更多信息

CATEGORY_LAUNCHER 意味着它应该出现在启动为顶级应用程序

请参阅该文档。

http://developer.android.com/reference/android/content/Intent.html http://developer.android.com/guide/topics/manifest/action-element.html

I have seen so many different confusing explenations..

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

What is the meaning of

<action android:name="android.intent.action.MAIN" />

and

 <category android:name="android.intent.category.LAUNCHER" />

and

 <category android:name="android.intent.category.DEFAULT" />

解决方案

android.intent.action.MAIN means that this activity is the entry point of the application, i.e. when you launch the application, this activity is created.

From the docs

ACTION_MAIN with category CATEGORY_HOME -- Launch the home screen.

Also,from here

Activity Action Start as a main entry point, does not expect to receive data.

android.intent.category.DEFAULT is mainly used for implicit intents. If your activity wishes to be started by an implicit intent it should include this catetory in its filter. If your Activity might be started by an implicit Intent when no specific category is assigned to it, its Intent filter should include this category.

android.intent.category.LAUNCHER

category -- Gives additional information about the action to execute.

CATEGORY_LAUNCHER means it should appear in the Launcher as a top-level application

See the docs..

http://developer.android.com/reference/android/content/Intent.html http://developer.android.com/guide/topics/manifest/action-element.html