Android開發-API指南-<action>

來源:互聯網
上載者:User

標籤:

<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:name
Action 的名稱。 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指南-<action>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.