I have a video wallpaper app in which I am trying to set the live wallpaper for the first time it works fine. But the second time it does not change the wallpaper unless I restart the device.
I tried using "wallpapermanager.clear" function as well but the problem with that is if the user doesn't set the wallpaper the previous wallpaper gets removed automatically.
I don't want the previous one to get removed.
Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
vintent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
new ComponentName(this, MyWallpaperService.class));
vstartActivity(intent);
try {
WallpaperManager.getInstance(this).clear();
} catch (IOException e) {
e.printStackTrace();
}
Save Your changes On
SharedPreferenceof yourWallPaperClass i.eMyWallpaperServiceuse below code and modify according to your need hopefully its help...OnSharedPreferenceChangeListeneruse to save data both previous and updated you just need to set condition when you want update