I noticed that when you are editing SharedPreferences you are using commit() In our tests commit takes about 10 milliseconds to write the changes to disk. You should probably use apply() instead of commit(). apply() writes the changes to disk asynchronously. The javadoc for commit() states the following:
If you don't care about the return value and you're using this from your application's main thread, consider using apply() instead.
I noticed that when you are editing SharedPreferences you are using commit() In our tests commit takes about 10 milliseconds to write the changes to disk. You should probably use apply() instead of commit(). apply() writes the changes to disk asynchronously. The javadoc for commit() states the following: