gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:31:45 36 4
gpt4 key购买 nike

enter image description here如何删除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
}
}

最佳答案

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

关于android - 如何删除应用程序快捷方式图标中的徽章?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50740956/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com