Note that there are some explanatory texts on larger screens.

plurals
  1. POApplication launcher icon is not deleted from Home screen when uninstalling android app
    text
    copied!<p>I'm using a similar codesnippet as shown below to add an application shortcut on the homescreen:</p> <pre><code> Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); shortcutIntent.setClassName(this, this.getClass().getName()); shortcutIntent.putExtra(EXTRA_KEY, "ApiDemos Provided This Shortcut"); // Then, set up the container intent (the response to the caller) Intent intent = new Intent(); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.shortcut_name)); Parcelable iconResource = Intent.ShortcutIconResource.fromContext( this, R.drawable.app_sample_code); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource); // Now, return the result to the launcher setResult(RESULT_OK, intent); </code></pre> <p>There is no problem with creating the shortcut, but when uninstalling the app, the shortcut remains on the homescreen. When uninstalling other apps they all seem to also remove their corresponding homescreen shortcuts. This is what i try to achieve with my "created-by-code-shortcut-icon"</p> <p><strong>Does any of you Android experts here on Stackoverflow know whats needed to remove the app shortcut from the homescreen when the app is uninstalled ?</strong></p> <p>I found some related threads, but they do not provide me the solution for my problem, but please feel free to catch up: </p> <p>[0] <a href="https://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/app/LauncherShortcuts.html" rel="nofollow noreferrer">https://developer.android.com/intl/de/resources/samples/ApiDemos/src/com/example/android/apis/app/LauncherShortcuts.html</a></p> <p>[1] <a href="https://stackoverflow.com/questions/972933/remove-application-from-launcher-programatically-in-android">Remove application from launcher programatically in Android</a></p> <p>[2] <a href="https://stackoverflow.com/questions/2131690/how-to-remove-application-shortcut-from-home-screen-on-uninstall-automatically">How to remove application shortcut from home screen on uninstall automatically?</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload