Simplify code logic in method saveSettingsAndQuit SettingsFragment.java