android - How to remove application shortcut from home screen on uninstall automatically? -


I am developing an application that should add its shortcut to the home screen after installation and uninstall it Has been removed after. The application will be pre-installed on the end-user device, but there should still be an option for uninstallation). This work looks very simple, but I have faced many problems in implementing it.

What I did:

  • Add Shortcut at Home
  • Manually com.android.launcher.action Remove the shortcut usingININSTALL_SHORTCUT.

What I can not (and almost give):

  • Installing the application Automatically remove shortcuts on cancellation

There is no way to use the intent. Action_PackageManMOVID does not get this intention because the application is being uninstalled. I did some tests and found that the only shortcut type being extracted with the application is that the shortcut created with the menu 'Add to Home Screen => Shortcuts => Application => App Activity' After uninstalling the app, those shortcuts are programmatically created or which have been announced in the Android manifest, the app is not installed after they are on the screen.

About this topic there are almost no documents and posts on the forums and why I am feeling a little confused, such a simple operation that does not contradict the Android security policy, it is implemented directly can not be done.

Is there any way to remove the related shortcut on the application from the OS? Can I catch the incident that the application is being uninstalled before it is removed?

I do not believe you can do this.

First of all, because you can not uninstall devices that are pre-installed on device firmware & mdash; They exist on the / system partition, which is a read only file system.

The second, as you note, your application.

If users do not want to use their apps, will they not just ignore app icons, such as for some pre-installed apps on my phone?


Edit:
If you are going to pre-install the application (but not as a commonsense.com com note form firmware), then you One can pre-install two apk, one of them is not a launcher and has only one broadcast receiver, which is ACTION_PACKAGE_REMOVED event and call UNINSTALL_SHORTCUT Handles.

I do not believe any clear permission check is required to add a shortcut to the app that it added, but you can access it anyway by using one for both APKs.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -