Use SharedPreferences.Editor.apply() whenever possible

commit() will hang the main thread for as long as it takes to write to an XML file, which leads to some jerkiness on occasion.