应用快捷方式
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Play 游戏服务可能会自动添加应用快捷方式,例如允许用户快速选择要使用的 Play 游戏服务玩家资料。系统可能会根据设备上的账号数量和游戏使用情况添加或移除应用快捷方式。
可用快捷键
玩家资料切换器:供玩家在不同的 Play 游戏玩家资料之间切换的快捷方式。如需查看相应的帮助中心文章,请参阅如何切换 Play 游戏玩家资料。
管理 Play 游戏服务填充的应用快捷方式
如果您的游戏主动使用应用快捷方式,您可以限制 Play 游戏服务填充的应用快捷方式数量。为此,请向任何 "android.intent.category.LAUNCHER"
activity 声明添加一个元数据元素,并设置以下内容:
android:name
到"com.google.android.gms.games.APP_SHORTCUTS_MAX_NUMBER"
android:value
设置为 Play 游戏服务可使用的应用快捷方式槽数上限。
示例
在本示例中,我们将展示如何将 Play 游戏服务可使用的应用快捷方式槽的数量上限限制为 2。在我们的示例中,我们最初的应用清单如下所示:
<manifest ... >
<application ... >
<activity android:name=".ExampleActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity >
...
</application >
...
</manifest >
如需应用限制,应用清单应更新为以下内容:
<manifest ... >
<application ... >
<activity android:name=".ExampleActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.google.android.gms.games.APP_SHORTCUTS_MAX_NUMBER"
android:value="2" />
</activity >
...
</application >
...
</manifest >
大功告成。现在,Play 游戏服务可以使用的应用快捷方式槽数量上限为 2 个。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],[],null,["# App shortcuts\n\nThe Play Games services may automatically add [app shortcuts](https://developer.android.com/develop/ui/views/launch/shortcuts), for\nexample to allow users to quickly choose the Play Games Services profile to use.\nThe app shortcuts could be added or removed based on the number of the accounts\non the device and the game usage.\n\nAvailable shortcuts\n-------------------\n\n**Profile switcher** : shortcut for players to switch between different Play\nGames Profiles. See [How to switch Play Games profiles](https://support.google.com/googleplay/answer/14754238), for\ncorresponding Help Center article.\n\nManage the Play Games services populated app shortcuts\n------------------------------------------------------\n\nIn case your game actively uses the app shortcuts, you could limit the number of\napp shortcuts populated by the Play Games services. For that add a\n[meta-data](https://developer.android.com/guide/topics/manifest/meta-data-element)\nelement to any `\"android.intent.category.LAUNCHER\"` activity declaration,\nsetting the following:\n\n- `android:name` to `\"com.google.android.gms.games.APP_SHORTCUTS_MAX_NUMBER\"`\n- `android:value` to the maximum number of the app shortcuts slots that can be used by the Play Games services.\n\n### Example\n\nIn this example, we show how to limit the maximum number of the app shortcuts\nslots that the Play Games services can use to **two** . For our example, we\ninitially would have an\n[app manifest](https://developer.android.com/guide/topics/manifest/manifest-intro)\nthat looks like the following: \n\n \u003cmanifest ... \u003e\n \u003capplication ... \u003e\n \u003cactivity android:name=\".ExampleActivity\" \u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n \u003ccategory android:name=\"android.intent.category.LAUNCHER\" /\u003e\n \u003c/intent-filter\u003e\n \u003c/activity \u003e\n ...\n \u003c/application \u003e\n ...\n \u003c/manifest \u003e\n\nAnd to apply the limits the app manifest should be updated to the following: \n\n \u003cmanifest ... \u003e\n \u003capplication ... \u003e\n \u003cactivity android:name=\".ExampleActivity\" \u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n \u003ccategory android:name=\"android.intent.category.LAUNCHER\" /\u003e\n \u003c/intent-filter\u003e\n \u003cmeta-data\n android:name=\"com.google.android.gms.games.APP_SHORTCUTS_MAX_NUMBER\"\n android:value=\"2\" /\u003e\n \u003c/activity \u003e\n ...\n \u003c/application \u003e\n ...\n \u003c/manifest \u003e\n\nThat's it. Now the maximum number of the app shortcuts slots that the Play Games\nservices can use is limited to **two**."]]