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

后端 未结 2 485
旧时难觅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);
    

提交回复
热议问题