in my application i'm using WallpaperManager to set an image as a wallpaper for the device the problem is that when the application is uninstalled the image will stay, though it should be deleted i thought about this approach which is detecting when the applications is uninstalled and clear the image or cash but it doesn't seems to work, it seems the un-installation event cant be detected is there any other approach to solve it? or any tip to delete the photo after the un-installation of the application ?
Asked
Active
Viewed 1,149 times
2
-
Why do you think all changes will be undone upon un-installing the application ? This is not true. – S.D. Jul 21 '13 at 11:49
-
Because by asking and thinking this way i learned something new from the below answer which is -Android is keeping the relative bitmap in the volatile memory- – mmoghrabi Jul 22 '13 at 06:31
-
1Wallpaper file is stored for each user at `data/system/users/0/wallpaper` where `0` is user id. The bitmap is kept into memory by launcher app for rendering purposes. So, file will be there if you un-install the app, just like any other settings change your app might have done. – S.D. Jul 22 '13 at 09:28
1 Answers
0
Even if you delete the image from the internal/external memory, the image will be still set as the wallpaper because Android is keeping the relative bitmap in the volatile memory.
You can use a BroadcastReceiver
to capture the uninstall Intent:
http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_REMOVED
But this will require you to install another application to listen for this Intent and then set a black background (or whatever you want) with
Note: It may be possible that after you uninstall your app and the restart the phone, the image will not be set as wallpaper anymore. It all depends whether Android keeps his own copy of the image of the wallpaper or not...just test for it!

type-a1pha
- 1,891
- 13
- 19