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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user