Is it posible to restart a wallpaper after a preference is changed?
I’m thinking I can use this to see the event. But I’m not sure how to update the wallpaper afterwards, if the wallpaper is already running.
public void onSharedPreferenceChanged(SharedPreferences prefs) {
}
Basically, I want to have a wallpaper with a preference that changes a bitmap being used in the canvas.
Yes, you can do this, and yes, you’ve got the right idea. 🙂 Your best place to start is to look at the “second” (resource) cube wallpaper SDK example, which changes its model (cube vs. dodecahedron) in onSharedPreferenceChanged, based on a user preference change.
In that example, they don’t mess with the drawing queue–just alter the data that gets used, but I don’t see why you couldn’t remove callbacks to your runnable and then restart your drawing process, if that better suits your purpose.