How to remove the badge in app shortcut icon?

Athira picture Athira · Jun 7, 2018 · Viewed 7.2k times · Source

enter image description hereHow to remove the badge in app shortcut icon in android? When i create app shortcut programmatically, along with the icon specified for shortcut, app icon comes at the bottom-right corner of the icon. I don't want that badge.

Here is the code I used

    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
    }
}

Answer

Vishal2 vasundhara picture Vishal2 vasundhara · Oct 12, 2018

No, there is no way. These additional options are added by launcher, not your app itself. Obviously, uninstall options will be not there if your app is not possible to be uninstalled (it's system app for example).