Android开发-API指南-<action>
2014-12-22 11:28
351 查看
<action>
英文原文:http://developer.android.com/guide/topics/manifest/action-element.html采集(更新)日期:2014-6-27
搬迁自原博客:http://blog.sina.com.cn/s/blog_48d491300100zmfi.html
语法:
<action android:name="string" />
包含于
<intent-filter>说明:在 Intent 过滤器中添加一个 Action。
<intent-filter>元素必须包含一个或多个
<action>元素。 如果其中没有包含任何
<action>元素,则过滤器不会收到任何 Intent 对象。 关于 Intent 过滤器及过滤器内各种 Action 的用途,详情请参阅 Intent 和 Intent 过滤器 。属性:
android:nameAction 的名称。
Intent类中已经以
ACTION_string常量的形式定义了一些标准的 Action。 要将这些 Action 赋予本属性,请以“
android.intent.action.”作为前缀,加在
ACTION_后的
string前面。 例如,对于
ACTION_MAIN而言,用“
android.intent.action.MAIN”, 对于
ACTION_WEB_SEARCH则用“
android.intent.action.WEB_SEARCH”。
对于自定义的 Action ,最好用包名作前缀,以确保唯一性。 例如
TRANSMOGRIFY动作可以定义如下:
<action android:name="com.example.project.TRANSMOGRIFY" />
引入自:API 级别 1参阅
<intent-filter>
相关文章推荐
- Android开发-API指南-<compatible-screens>
- Android开发-API指南-<intent-filter>
- Android开发-API指南-<uses-permission>
- Android开发-API指南-<service>
- Android开发-API指南-<application>
- Android开发-API指南-<category>
- Android开发-API指南-<activity-alias>
- Android开发-API指南-<application>[原创译文]
- Android开发-API指南-<supports-screens>
- Android开发-API指南-<permission-group>
- Android开发-API指南-<manifest>
- Android开发-API指南-<path-permission>
- Android开发-API指南-<permission-tree>
- Android开发-API指南-<uses-configuration>
- Android开发-API指南-<permission>
- Android开发-API指南-<instrumentation >
- Android开发-API指南-<receiver>
- Android开发-API指南-<activity-alias>[原创译文]
- Android开发-API指南-<uses-library>
- Android开发-API指南-<supports-gl-texture>