I am trying to change the current user wallpaper. I have set the set_wallpaper permission and it works. But when I change the wallpaper I have to wait about 15 seconds to see the wallpaper change.
This is currious because if I check the lock screen it has already changed.
Here is my code:
public static void setWallpaper(final Context context, final Bitmap image){
Thread thread = new Thread() {
@Override
public void run() {
WallpaperManager wallpaperManager = WallpaperManager.getInstance(context.getApplicationContext());
try {
if(image != null){
wallpaperManager.setBitmap(image);
}
} catch (IOException ignored) {}
}
};
thread.start();
}
I'm on Android 6. Any help would be appreciated.