0

Is there any way to detect whether live wallpaper or static wallpaper is currently set on the homescreen. I would like to do certain operation based on these condition.

I've have already checked on the internet but couldn't find any solution. So any help will be much appreciated. Thanks you.

1 Answer 1

2

WallpaperManager to your rescue!!

It has a getWallpaperInfo() that:

If the current wallpaper is a live wallpaper component, return the information about that wallpaper. Otherwise, if it is a static image, simply return null.

Code snippet:

WallpaperManager mgr = WallpaperManager.getInstance(MyActivity.this);
if( mgr.getWallpaperInfo() == null ){
    // static wallpaper
}else{
    // live wallpaper
}
2
  • Wow! works like a charm. I've been looking for this. Thank you sooooooooo much for the help :) Sep 29, 2014 at 16:48
  • Glad I could help! Have fun developing your app!
    – An SO User
    Sep 29, 2014 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.