I\'ve created an Android live wallpaper and i\'m trying to let a user choose an image from their phone and apply it as a background image, but when I launch the activity tha
In my case I had to add editor.apply(); before commit in order to work.
This is my code:
preferences = getApplicationContext().getSharedPreferences(PREFERENCES_NAME, 0);
SharedPreferences.Editor editor = preferences.edit();
editor.putString(SETTINGS_BACKGROUND_IMAGE, "okok");
editor.apply();//I added this line and started to work...
editor.commit();