SharedPreferences.getBoolean returns true everytime

后端 未结 4 1905
粉色の甜心
粉色の甜心 2020-12-20 16:07

I made a class for handling important data changes such as App Purchase Status and other stuff .

For this goal I have created a class which does the setting and read

4条回答
  •  旧巷少年郎
    2020-12-20 16:53

    For those still having a problem, remember to apply the changes to your preferences.

     private SharedPreferences sharedPreferences ;
     private SharedPreferences.Editor sharedPreferencesEditor;
    
     sharedPreferencesEditor.putBoolean("myVariable", false);
     sharedPreferencesEditor.apply();
    

提交回复
热议问题