什么是android.intent.action.MAIN意思? [英] What is the meaning of android.intent.action.MAIN?

查看:1410
本文介绍了什么是android.intent.action.MAIN意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

 <意向滤光器>
     <作用机器人:名称=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 意味着它应该出现在启动为顶级应用程序

请参阅该文档。

  1. <一个href="http://developer.android.com/reference/android/content/Intent.html">http://developer.android.com/reference/android/content/Intent.html
  2. <一个href="http://developer.android.com/guide/topics/manifest/action-element.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..

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

这篇关于什么是android.intent.action.MAIN意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆