
如何移除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
}
}发布于 2018-10-12 16:31:41
不,没有办法。这些附加选项是由launcher添加的,而不是您的应用程序本身。显然,如果您的应用程序无法卸载(例如系统应用程序),则卸载选项将不存在。
https://stackoverflow.com/questions/50740956
复制相似问题