Search code examples
androidlive-wallpaper

How can i be notified "set wallpaper" hits in android Wallpaper Service?


I have a wallpaper service in my application which user should only use my application wallpapers.

if user hits "set wallpaper" for the first time my wallpaper service will start to run. now if the user wants to set another wallpaper in my application, how can i be notified user hits "set wallpaper"?

because already my wallpaper service started, and i cannot find out "set wallpaper" hit or not.

what is your solutions?

thanks.


Solution

  • I think you should use startActivityForResult() instead of startActivity() to get result of "set wallpaper" button. In onActivityResult() you can check with the resultCode, if returns RESULT_OK it means user hit "set wallpaper" button.