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

Commit c12b1b40 authored by Lee Chou's avatar Lee Chou
Browse files

Fixes ApnEditor not restoring previous UI

ApnEditor tries read and set the UI in onCreate, before the previous bundle
is restored. This caused problems when the configuration has changed (such
as switching to Dark Theme).

This moves the UI changes to onViewRestored

Fixes: 146399432
Test: make SettingsGoogle and manual test UI
Change-Id: I8147ec96569fa28867c088d6c36584aa344f40ed
parent 9f6351b5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.View.OnKeyListener;

import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
import androidx.preference.EditTextPreference;
@@ -388,8 +389,12 @@ public class ApnEditor extends SettingsPreferenceFragment
        for (int i = 0; i < getPreferenceScreen().getPreferenceCount(); i++) {
            getPreferenceScreen().getPreference(i).setOnPreferenceChangeListener(this);
        }
    }

        fillUI(icicle == null);
    @Override
    public void onViewStateRestored(@Nullable Bundle savedInstanceState) {
        super.onViewStateRestored(savedInstanceState);
        fillUI(savedInstanceState == null);
    }

    @VisibleForTesting