SharedPreferences.Editor.commit ()

I have an editor instance, but it constantly does not execute commit () for several of my users:

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Editor editor = prefs.edit(); editor.putString(..., ...); if (!editor.commit()) { ... } 

I am not sure why this would be unsuccessful for them (all my thousands of other users run these lines in order). Is there any way to get more information here? I am just logging the fact that the commit () value returns false, so at least I know what is happening, but I don’t know how to fix it,

thanks

+4
source share

Source: https://habr.com/ru/post/1410786/


All Articles