I'm about to launch my first app in a week,and want to know if google play automatically adds the shortcut to the home-screen or is it something if have to do with code. I have question like this but there's nothing about creating shortcut on install.
Asked
Active
Viewed 218 times
0
-
1The shortcut is automatically added. – loshkin Jun 28 '16 at 11:49
-
if the shortcut is automatically added.why some users are giving the below answers? – pavitran Jun 28 '16 at 12:18
-
thank you @konrad-krakowiak yeah the shortcut is automatically added by google play. – pavitran Jul 05 '16 at 16:28
4 Answers
1
I launched my app found that Google Play does automatically creates a shortcut on the homescreen and we don't have to do it in our code,although i don't know if it works the same way in Amazon app store. hope this helps someone who is trying to find answer to the same question.

pavitran
- 814
- 1
- 10
- 25
1
Mohit Madaan's answer was correct. Just don't forget to set duplicate to false otherwise you might have several shortcuts:
addIntent.putExtra("duplicate", false);

Behzad Rostami
- 61
- 4
0
put this permission in manifest
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
below for creating the shortcut icon on android Homescreen
private void ShortcutIcon(){
Intent shortcutIntent = new Intent(getApplicationContext(), MainActivity.class);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Intent addIntent = new Intent();
addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Test");
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(getApplicationContext(), R.drawable.ic_launcher));
addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
getApplicationContext().sendBroadcast(addIntent);}

Mohit Madaan
- 469
- 2
- 11
0
I came across this and I hope this helps you. http://viralpatel.net/blogs/android-install-uninstall-shortcut-example/

Mew
- 1,132
- 2
- 10
- 19