Trying to UNINSTALL_SHORTCUT but shortcut won't go away

后端 未结 5 787
小蘑菇
小蘑菇 2020-11-28 10:18

I created a test Activity that installs a shortcut of itself on the Android Home screen. When you click a button, the Activity is supposed to remove the same shortcut it ju

5条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 10:46

    While both solutions from Dev-iL and Funt work be advised they do so until Marshmallow. With Android 6.0 (which has Launcher v3) Google has removed the UninstallShortcutReceiver because of its security problems (probably because it became apparent here). So do not expect it to work with Android 6.0. Hopefully in some future release it will be readded in a form or another.

    PS: Normally this should be a comment, but I am not allowed to comment because of the reputation...

提交回复
热议问题