Skip to content

Commit

Permalink
Post updateBravePreferences() in onResume().
Browse files Browse the repository at this point in the history
Run updateBravePreferences() after fininshing MainPreferences::updatePreferences().
Otherwise, some prefs could be added after finishing updateBravePreferences().
  • Loading branch information
simonhong committed Sep 26, 2019
1 parent 72f720c commit 20b5205
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public class BraveMainPreferencesBase extends PreferenceFragmentCompat {
private final HashMap<String, Preference> mRemovedPreferences = new HashMap<>();

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
updateBravePreferences();
}
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {}

@Override
public void onResume() {
super.onResume();
updateBravePreferences();
// Run updateBravePreferences() after fininshing MainPreferences::updatePreferences().
// Otherwise, some prefs could be added after finishing updateBravePreferences().
new Handler().post(() -> updateBravePreferences());
}

private void updateBravePreferences() {
Expand Down

0 comments on commit 20b5205

Please sign in to comment.