0

I am trying to make a code to detect a long press on my app icon. When my app icon is long pressed to open the menu(app info, uninstall, and other shortcuts), another screen should be put up so that the user can't get access the options. I just need to know how to detect long press on my app icon.

Have read Detecting a long press with Android, but there is no answer related on how to detect the same on my android app icon?

David Wasser
  • 93,459
  • 16
  • 209
  • 274
captain_cold
  • 25
  • 1
  • 5
  • Removed tag `android-studio` as that tag is for questions/problems related to the Android Studio product. Your question is a generic Android question and has nothing to do with Android Studio. – David Wasser Apr 16 '21 at 10:48
  • Please let us know if you found an answer, I'm looking for the same thing! – Flyview Oct 01 '21 at 19:36
  • It looks like the "Detoxify" app is able to do this so there is definitely a way. – Flyview Oct 01 '21 at 20:31

1 Answers1

0

It is possible to make shortcuts for launcher icon.

Look here: https://developer.android.com/guide/topics/ui/shortcuts.html

yuralife
  • 1,545
  • 2
  • 21
  • 35
  • I've looked into this, and made some test shortcuts. Is there any way to be notified when these shortcuts are displayed? i.e. when the launcher icon is long-pressed? – Flyview Oct 27 '21 at 00:41