Java 从锁定的快捷方式中删除应用程序图标

Java 从锁定的快捷方式中删除应用程序图标,java,android,shortcut,android-shortcut,Java,Android,Shortcut,Android Shortcut,8安卓之后,我的应用程序图标出现在快捷方式上 我知道这是专门为通知用户哪个应用程序创建了快捷方式而添加的 以下是当前用于创建图标的代码 ShortcutManager shortcutManager = (ShortcutManager) context.getSystemService(Context.SHORTCUT_SERVICE); BitmapDrawable bd = (BitmapDrawable) ic; if (shortcutManager.isReq

8安卓之后,我的应用程序图标出现在快捷方式上

我知道这是专门为通知用户哪个应用程序创建了快捷方式而添加的

以下是当前用于创建图标的代码

   ShortcutManager shortcutManager = (ShortcutManager) context.getSystemService(Context.SHORTCUT_SERVICE);
    BitmapDrawable bd = (BitmapDrawable) ic;
    if (shortcutManager.isRequestPinShortcutSupported()) {
        Intent shortcutInfoIntent = new Intent(context, MainActivity.class);
        shortcutInfoIntent.setAction(Intent.ACTION_VIEW);
        shortcutInfoIntent.putExtra("pckg", pck);

        ShortcutInfo info = new ShortcutInfo.Builder(context, "iconId")
                .setIcon(Icon.createWithBitmap(bd.getBitmap()))
                .setShortLabel(label)
                .setIntent(shortcutInfoIntent)
                .build();

        PendingIntent shortcutCallbackIntent = PendingIntent.getBroadcast(context, 0, new Intent(context, MyReceiver.class), PendingIntent.FLAG_UPDATE_CURRENT);

        shortcutManager.requestPinShortcut(info, shortcutCallbackIntent.getIntentSender());
    }
我知道这是一个相当普遍的问题,但没有人提供正常的解决方案。 但我得想办法把它拿走

我确信这是可能的,因为它是在中实现的,在那里创建的图标没有这些徽章

请写下你所有的想法如何解决它

我确信这是可能的,因为它是在x图标转换器中实现的,在x图标转换器中创建的图标没有这些徽章

他们使用应用程序小部件来实现这一点。请参阅中的“关于水印”

请写下你所有的想法如何解决它


编写一个应用程序小部件。

感谢您的回答,已经可以通过小部件删除徽章,我想找到一种不使用widget的方法删除它。另外,在x图标转换器中,不再需要创建小部件,图标已经创建,没有徽章,您可以自己尝试