Skip to content

Commit

Permalink
Preferences: avoid non-default constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed May 17, 2019
1 parent 6b8f790 commit 04c84ca
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
import java.util.List;
import java.util.Map;

import lombok.RequiredArgsConstructor;
import lombok.Setter;

/**
* A {@link PreferenceActivity} that presents a set of application settings. On
Expand Down Expand Up @@ -134,7 +134,8 @@ public class Preferences extends BasePreferenceActivity implements SearchPrefere


private void refreshFragments() {
this.preferenceFragment = new AllPrefsFragment(this);
this.preferenceFragment = new AllPrefsFragment();
this.preferenceFragment.setParent(this);
pFragment = this.preferenceFragment;
getFragmentManager().beginTransaction().replace(android.R.id.content,
this.preferenceFragment).commit();
Expand Down Expand Up @@ -723,10 +724,11 @@ private static void bindPreferenceSummaryToValueAndEnsureNumeric(Preference pref
}


@RequiredArgsConstructor

public static class AllPrefsFragment extends PreferenceFragment {

final Preferences parent;
@Setter
Preferences parent;
SharedPreferences prefs;
SearchConfiguration searchConfiguration;

Expand Down Expand Up @@ -2000,7 +2002,7 @@ public void run() {
JoH.runOnUiThread(new Runnable() {
@Override
public void run() {
parent.refreshFragments();
if (parent != null) parent.refreshFragments();
}
});
} catch (Exception e) {
Expand Down

0 comments on commit 04c84ca

Please sign in to comment.