Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Live Wallpaper automatically everyday in android

I am developing a wallpaper app. We can add simple wallpaper automatically by using the following code with a service.

        final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
        final Drawable wallpaperDrawable = wallpaperManager.getDrawable();
        final ImageView imageView = (ImageView) findViewById(R.id.imageview);
        imageView.setDrawingCacheEnabled(true);
        imageView.setImageDrawable(wallpaperDrawable);

Now i have to set Live Wallpaper automatically using a service, means Live Wallpaper should set automatically everyday on Screen. how can we do this???

Thanks

like image 227
Himanshu Avatar asked Apr 03 '12 14:04

Himanshu


2 Answers

You can launch the wallpaper chooser with your live wallpaper pre-selected, but there doesn't currently appear to be a way to set it without user intervention.

See this for the Intent to fire to do this as well as see the documentation for the Extra you need to supply to preselect your live wallpaper. http://developer.android.com/reference/android/app/WallpaperManager.html#ACTION_CHANGE_LIVE_WALLPAPER

like image 133
PaulR Avatar answered Nov 13 '22 09:11

PaulR


It's impossible to set Live Wallpaper programmatically without any user interaction. Even on rooted device you can't set the Live Wallpaper, you can't surpass the LiveWallpaperSerivce system class.

like image 30
Naskov Avatar answered Nov 13 '22 10:11

Naskov