Home Screen Listener?

208 Views Asked by At

I want to detect if the user has manually added or remove a shortcut of my application in the home screen. I tried to use broadcast receivers for the actions below: com.android.launcher.permission.UNINSTALL_SHORTCUT com.android.launcher.permission.INSTALL_SHORTCUT

But they are not triggered when I manually adding or removing a shortcut of my application to and from my homescreen.

I wonder if there are listeners for this? I searched on Android Developer site and didn't find any information about this.

1

There are 1 best solutions below

0
On BEST ANSWER

So for anyone who encounter this issue. I tried to solve this with different approaches as described below:

  1. To use broadcast receivers for the actions com.android.launcher.permission.UNINSTALL_SHORTCUT com.android.launcher.permission.INSTALL_SHORTCUT but as I said before, they were not triggered and I couldn't listened for the home screen in order to detect if the user has manually added or removed a shortcut. Moreover, @CommonsWare comment is correct :)

  2. I tried to check inside my application, using ShortcutManager or PackageManager and see if the application shortcut already exists on the Home Screen, but as you can guess, there was no way to find it...

So... bottom line -> it is not possible