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

后端 未结 2 1274
小鲜肉
小鲜肉 2021-02-11 01:35

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:26

    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);
    

提交回复
热议问题