Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e82ca817 authored by Tom Hsu's avatar Tom Hsu Committed by Automerger Merge Worker
Browse files

Merge "[Panlingual] Fix the back button press" into tm-dev am: a9d7aae6

parents 5bcd2f7f a9d7aae6
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -95,26 +95,12 @@ public class AppLocalePickerActivity extends SettingsBaseActivity
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            handleBackPressed();
            super.onBackPressed();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onBackPressed() {
        handleBackPressed();
    }

    private void handleBackPressed() {
        if (getFragmentManager().getBackStackEntryCount() > 1) {
            super.onBackPressed();
        } else {
            setResult(RESULT_CANCELED);
            finish();
        }
    }

    @Override
    public void onLocaleSelected(LocaleStore.LocaleInfo localeInfo) {
        if (localeInfo == null || localeInfo.getLocale() == null || localeInfo.isSystemLocale()) {