android - get image of current live wallpaper -
i working on android app extracts dominant colours current wallpaper using wallpapermanager , new palette api. have problem because can't extract colours when using live wallpaper muzei example. how go on that? there must check use other wallpapermanager if live wallpaper set. or maybe there's possibility of grabbing screenshot of live wallpaper?
thanks!
solution:
//reference package manager instance packagemanager pm = getapplicationcontext().getpackagemanager(); /* * wallpaper info not equal null, if live wallpaper * set, drawable image package * live wallpaper */ drawable wallpaperdrawable = null; if (wallpapermanager.getinstance(this).getwallpaperinfo() != null) { wallpaperdrawable = wallpapermanager.getinstance(this).getwallpaperinfo().loadthumbnail(pm); } /* * else, if static wallpapers set, directly * wallpaper image */ else { wallpaperdrawable = wallpapermanager.getinstance(this).getdrawable(); } //drawable wallpaperdrawable = wallpapermanager.getinstance(this).getdrawable(); //toast.maketext(this,"wallpaper info: " + wallpapermanager.getinstance(this).getwallpaperinfo(), toast.length_short).show(); drawable wallpaperdrawable2 = wallpaperdrawable;
yah can take screenshot using androing phone's volume down key + lock key press volume down key + lock key @ same time can take screen shot.
Comments
Post a Comment