Intent.CategoryAccessibilityShortcutTarget 欄位
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
無障礙捷徑是全球性的手勢,讓身心障礙使用者觸發一項對他們重要的無障礙功能,幫助開發者決定是否要將活動設為捷徑目標。
[Android.Runtime.Register("CATEGORY_ACCESSIBILITY_SHORTCUT_TARGET", ApiSince=30)]
public const string CategoryAccessibilityShortcutTarget;
[<Android.Runtime.Register("CATEGORY_ACCESSIBILITY_SHORTCUT_TARGET", ApiSince=30)>]
val mutable CategoryAccessibilityShortcutTarget : string
欄位值
實作
- 屬性
備註
無障礙捷徑是全球性的手勢,讓身心障礙使用者觸發一項對他們重要的無障礙功能,幫助開發者決定是否要將活動設為捷徑目標。
對於有無障礙需求的使用者感興趣的活動,可能會要求成為無障礙捷徑的目標。 它用這個類別處理意圖 #ACTION_MAIN ,當使用者設定指向該目標時,系統會派遣該類別。
AndroidManifest.xml中,一個活動宣告自己是捷徑的目標。 它還必須做兩件事:ul<ol 指定它處理 >< 帶有 的類別 >。android.intent.action.MAINandroid.content.Intentandroid.intent.category.ACCESSIBILITY_SHORTCUT_TARGET
</ol><ol> 在申報活動時,請在清單中提供一個元資料條目 android.accessibilityshortcut.target 。
</ol></ul> 如果缺少這兩個項目,系統將忽略無障礙捷徑目標。 以下是宣告範例:
<activity android:name=".MainActivity"
. . .
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.ACCESSIBILITY_SHORTCUT_TARGET" />
</intent-filter>
<meta-data android:name="android.accessibilityshortcut.target"
android:resource="@xml/accessibilityshortcut" />
</activity>
這是一個範例 XML 檔案,設定一個無障礙捷徑目標:
<accessibility-shortcut-target
android:description="@string/shortcut_target_description"
android:summary="@string/shortcut_target_summary"
android:animatedImageDrawable="@drawable/shortcut_target_animated_image"
android:htmlDescription="@string/shortcut_target_html_description"
android:settingsActivity="com.example.android.shortcut.target.SettingsActivity" />
描述與摘要都是必要的。 如果缺少無障礙捷徑目標,系統會忽略這些目標。 支援動畫圖片與 HTML 描述,幫助使用者了解如何使用捷徑目標。 設定活動是一個元件名稱,允許使用者修改此無障礙捷徑目標的設定。
Java 文件 android.content.Intent.CATEGORY_ACCESSIBILITY_SHORTCUT_TARGET。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。