“android.shortcut.conversation”在shortcuts.xml 中是什么意思?

Mik*_*ail 2 android android-shortcut

<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
  <shortcut
    android:shortcutId="compose"
    android:enabled="true"
    android:icon="@drawable/compose_icon"
    android:shortcutShortLabel="@string/compose_shortcut_short_label1"
    android:shortcutLongLabel="@string/compose_shortcut_long_label1"
    android:shortcutDisabledMessage="@string/compose_disabled_message1">
    <intent
      android:action="android.intent.action.VIEW"
      android:targetPackage="com.example.myapplication"
      android:targetClass="com.example.myapplication.ComposeActivity" />
    <!-- This -->
    <categories android:name="android.shortcut.conversation" />
  </shortcut>
</shortcuts>
Run Code Online (Sandbox Code Playgroud)

还有什么其他价值可用?我是否需要包括这个类别,如果我删除它会怎样?

我在官方文档中没有找到这个 - https://developer.android.com/guide/topics/ui/shortcuts.html

Sam*_*Sam 6

categories标签用于为应用的快捷方式执行的操作类型提供分组。可用组之一是android.shortcut.conversation,如果您想为聊天应用程序的对话添加快捷方式,则可以使用该组。例如,最近聊天头的快捷方式。当您想提供所述快捷方式时,您只需将其添加到您的快捷方式.xml 中。否则你不需要它。你可以删除它。对于 API 级别 26 或更低,这是唯一可用的值。但是对于更高版本有多个。

有关支持的快捷方式类别列表,您可以查看页面。