WAI
Status Update
Comments
am...@google.com <am...@google.com>
lb...@gmail.com <lb...@gmail.com> #2
This is even more important, if we chose to create a pinned shortcut to another app, and this app was removed.
am...@google.com <am...@google.com> #3
Thank you for the recommendations. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
om...@google.com <om...@google.com> #4
Apps are explicitly prohibited to remove pinned shortcuts to avoid user confusion, but can use disableShortcuts() to disable them (disable == not lauchable).
https://developer.android.com/reference/android/content/pm/ShortcutManager.html#disableShortcuts(java.util.List <java.lang.String>, java.lang.CharSequence)
And can update shortcuts too.
https://developer.android.com/reference/android/content/pm/ShortcutManager.html#updateShortcuts(java.util.List <android.content.pm.ShortcutInfo>)
You can use updateShortucts to set a custom disabled message to explain why it's no longer enabled to let the user decide whether to keep it or not. If they're temporarily disabled then the user may want to keep it.
And can update shortcuts too.
You can use updateShortucts to set a custom disabled message to explain why it's no longer enabled to let the user decide whether to keep it or not. If they're temporarily disabled then the user may want to keep it.
lb...@gmail.com <lb...@gmail.com> #5
@4 If I created a pinned shortcuts to something that doesn't exist anymore (an app, for example), there is no reason to let it stay on the launcher.
Please allow to remove them.
Disabling will do the exact same as not doing anything, because the app doesn't exist anymore, so there is a message telling you that.
Please allow to remove them.
Disabling will do the exact same as not doing anything, because the app doesn't exist anymore, so there is a message telling you that.
ja...@gmail.com <ja...@gmail.com> #6
Oh! I think that pinned shortcuts can be removed. like dynamic shortcuts, that's allowed. I don't know why they have different behavior???
First if a pinned shortcut is created by a app, it should have permission to remove it. For example, the browser creates some pinned shortcuts about third websites, and provide a page to manager them, remove one of them. Do i disable it??? then user click it on the launcher, prompt some messages and delete it? it's very unfriendly. it's like the browser can manager the website notification, permissions... including shortcuts.
Except the browser, the contract app create a person shortcut. when this person information is deleted by user in the contract, who did remove shortcut on the launcher??? And the document apps might have these questions. Now many people have the same needs.
Disabling will do the exact same as not doing anything, because the app doesn't exist anymore. There is no reason to let it stay on the launcher. That only affect the user. For a app, it will prompt the user what happened before removing a shortcut.
Please consider it carefully and look forward your reply.
First if a pinned shortcut is created by a app, it should have permission to remove it. For example, the browser creates some pinned shortcuts about third websites, and provide a page to manager them, remove one of them. Do i disable it??? then user click it on the launcher, prompt some messages and delete it? it's very unfriendly. it's like the browser can manager the website notification, permissions... including shortcuts.
Except the browser, the contract app create a person shortcut. when this person information is deleted by user in the contract, who did remove shortcut on the launcher??? And the document apps might have these questions. Now many people have the same needs.
Disabling will do the exact same as not doing anything, because the app doesn't exist anymore. There is no reason to let it stay on the launcher. That only affect the user. For a app, it will prompt the user what happened before removing a shortcut.
Please consider it carefully and look forward your reply.
lb...@gmail.com <lb...@gmail.com> #7
@6 Sadly they've already closed this issue. :(
Please write a new thread and I will join you .
Please write a new thread and I will join you .
Description
The only thing that can be removed is dynamic shortcuts, which are different. Using those on pinned shortcuts won't do anything:
ShortcutManager shortcutManager = (ShortcutManager) getSystemService(SHORTCUT_SERVICE);
final List<ShortcutInfo> pinnedShortcuts = shortcutManager.getPinnedShortcuts();
final ArrayList<String> shortcutIdsToRemove = new ArrayList<>();
for (ShortcutInfo pinnedShortcut : pinnedShortcuts) {
final Intent pinnedShortcutIntent = pinnedShortcut.getIntent();
shortcutIdsToRemove.add(pinnedShortcut.getId());
}
shortcutManager.disableShortcuts(shortcutIdsToRemove);
shortcutManager.removeDynamicShortcuts(shortcutIdsToRemove);
As an example of why this would be useful, suppose I offer to get to a direct screen of my app, through a pinned shortcut that is offered to the user via the app, and on the next version of the app, this screen is gone. What I'd like to do is to remove it, because it won't do anything.
it also can't be updated, for the same reason.
Please add API to remove and update pinned shortcuts.