Android - Shared Preferences Crashes On Some Devices.
I have this exception that I get in my crash reports from Android: java.lang.NoSuchMethodError: android.content.SharedPreferences$Editor.apply at com.problemio.ProblemioActivity.fi
Solution 1:
apply()
was introduced in API level 9, and some devices that runs your app may be with lower version. consider changing this call to commit
. As stated in the docs:
The SharedPreferences.Editor interface isn't expected to be implemented directly. However, if you previously did implement it and are now getting errors about missing apply(), you can simply call commit() from apply().
Solution 2:
Read the documentation:
http://developer.android.com/reference/android/content/SharedPreferences.Editor.html#apply()
Look at the api version that it was started with.
Post a Comment for "Android - Shared Preferences Crashes On Some Devices."