SharedPreferences editor has a commit method. It will block your UI thread, sometimes for quite noticable time. Better to use apply() when possible. read more here: Srool The Knife: StackOverflow Programming
This is a good tip and one aspect of SharedPreferences that I usually forget. I want to add one little note... this "apply" is only API 9 (Android 2.3 - Gingerbread) and up.
Good practice would be to just check for which SDK the user is like so (in the most basic form):
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.