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