Prevent changing to a theme if it's already set
This may resolve issues with some devices reloading when attempting to enter settings.
This commit is contained in:
parent
24504bc22e
commit
e392d4702c
|
@ -197,12 +197,15 @@ public class OptionsFragment extends Fragment {
|
|||
@Override
|
||||
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, int position, long id) {
|
||||
String theme = String.valueOf(parentView.getItemAtPosition(position));
|
||||
int current = mPrefs.getInt(Config.pref_app_theme, 0);
|
||||
if (theme.equals("Dream")) {
|
||||
mPrefs.edit().putInt(Config.pref_app_theme, 7).apply();
|
||||
mCallback.recreateActivity();
|
||||
if (current != 7)
|
||||
mCallback.recreateActivity();
|
||||
} else {
|
||||
mPrefs.edit().putInt(Config.pref_app_theme, position).apply();
|
||||
mCallback.recreateActivity();
|
||||
if (current != position)
|
||||
mCallback.recreateActivity();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue