Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to make the android application remove desktop shortcut when user delete it from main How can i make an android application that when the user delete the main application from mobile it delete by herself the desktop
Posted
Comments
merridus 9-Jan-12 6:48am    
Do you mean when the user uninstalls the application you want any icons placed on the homepage for the application to be removed?

It should do that by default should it not?

1 solution

Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
shortcutIntent.setClassName(this, this.getClass().getName());
final Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
intent.setAction("com.android.launcher.permission.UNINSTALL_SHORTCUT");
NB in manifest file use permission to uninstall shortcut
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900