如何在应用程序快捷方式图标中删除徽章?

Ath*_*ira 5 android android-shortcut pinned-shortcut

在此处输入图片说明如何在Android中的应用程序快捷方式图标中删除徽章?当我以编程方式创建应用程序快捷方式时,连同为快捷方式指定的图标一样,应用程序图标位于图标的右下角。我不要那个徽章

这是我使用的代码

    public static void addShortcutToHomeScreen(Context context)
{
    if (ShortcutManagerCompat.isRequestPinShortcutSupported(context))
    {
        ShortcutInfoCompat shortcutInfo = new ShortcutInfoCompat.Builder(context, "#1")
                .setIntent(new Intent(context, Splash.class).setAction(Intent.ACTION_MAIN)) // !!! intent's action must be set on oreo
                .setShortLabel("Test")
                .setIcon(IconCompat.createWithResource(context, R.drawable.logo))
                .build();
        ShortcutManagerCompat.requestPinShortcut(context, shortcutInfo, null);
    }
    else
    {
        // Shortcut is not supported by your launcher
    }
}
Run Code Online (Sandbox Code Playgroud)

小智 2

不,没有办法。这些附加选项是由启动器添加的,而不是您的应用程序本身。显然,如果您的应用程序无法卸载(例如系统应用程序),则卸载选项将不存在。