I have a litlte code to add a shortcut to homescreen for the first running time:
Intent shortcutIntent = new Intent(getApplicationContext(),
SFlashActivity.class);
shortcutIntent.setAction(Intent.ACTION_MAIN);
Intent addIntent = new Intent();
addIntent
.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "New App");
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(getApplicationContext(),
R.drawable.ic_launcher));
addIntent
.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
addIntent
.putExtra("duplicate", false);
getApplicationContext().sendBroadcast(addIntent);
But with above code, my app always start Splash screen althought my app is running. So how could i make home screen shortcut resume to top activity. I noticed that, app's shortcut made by google play on install always resume the top activity.
Thank so much !