1

I followed How can I add my application's shortcut to the homescreen upon app installation? to have shortcut icon of my app on screen. It is working fine. But the issue is when I click on the shortcut icon to launch, it creates one more shortcut icon.

How to avoid that? In case I delete one icon, the app creates it again on opening.

Community
  • 1
  • 1
Panache
  • 1,701
  • 3
  • 19
  • 33

2 Answers2

1

I tried with sharedpreference and saved its value first time and checking on next call before calling method to create shortcut. Working fine now.

Panache
  • 1,701
  • 3
  • 19
  • 33
1

I use a flag in Shared Preferences to keep track of whether I created a shortcut already or not. From what I could find, there's no way to check if the shortcut already exists on the home screen.

Ewald
  • 5,691
  • 2
  • 27
  • 31