How do I restart this wallpaper engine after settings have been updated?

后端 未结 2 486
旧时难觅i
旧时难觅i 2021-02-11 01:29

I\'m creating a live wallpaper and I\'m using this tutorial as a starting point:

http://code.tutsplus.com/tutorials/create-a-live-wallpaper-on-android-using-an-animated

相关标签:
2条回答
  • 2021-02-11 02:27

    I'm propably late, but hope someone will find this useful.

    You need to specify and register you SharedPrefs first. Add this to your onCreate() method.

    SharedPreferences preferences = getSharedPreferences("PREFERENCES NAME", Context.MODE_PRIVATE);
            preferences.registerOnSharedPreferenceChangeListener(this);
    
    0 讨论(0)
  • 2021-02-11 02:28

    I don't know if you found your answer, but i saw this in the android ref:

    WallpaperService.Engine onCreateEngine ()

    Must be implemented to return a new instance of the wallpaper's engine. Note that multiple instances may be active at the same time, such as when the wallpaper is currently set as the active wallpaper and the user is in the wallpaper picker viewing a preview of it as well.

    chris

    0 讨论(0)
提交回复
热议问题