1: Create icons as follows
Copy Code code as follows:
Intent Intent = new Intent ();
Intent.setclass (this, splashactivity.class);
Intent addshortcut = new Intent (action_add_shortcut);
parcelable icon = Intent.ShortcutIconResource.fromContext (This,
R.drawable.icon);
Addshortcut.putextra (Intent.extra_shortcut_name, getString (r.string.app_name));
Addshortcut.putextra (Intent.extra_shortcut_intent, Intent);
Addshortcut.putextra ("Duplicate", 0);
Addshortcut.putextra (Intent.extra_shortcut_icon_resource, ICON);
Sendbroadcast (Addshortcut);
2: Delete icon as follows
Copy Code code as follows:
Intent Intent = new Intent ();
Intent.setclass (this, splashactivity.class);
Intent.setaction ("Android.intent.action.MAIN");
Intent.addcategory ("Android.intent.category.LAUNCHER");
Intent addshortcut = new Intent (action_add_shortcut);
parcelable icon = Intent.ShortcutIconResource.fromContext (This,
R.drawable.icon);
Addshortcut.putextra (Intent.extra_shortcut_name, getString (r.string.app_name));
Addshortcut.putextra (Intent.extra_shortcut_intent, Intent);
Addshortcut.putextra ("Duplicate", 0);
Addshortcut.putextra (Intent.extra_shortcut_icon_resource, ICON);
Sendbroadcast (Addshortcut);
Intent.setaction ("Android.intent.action.MAIN");
Intent.addcategory ("Android.intent.category.LAUNCHER");
Requires two filter properties