From b3fb6f34ee33750c391a58eb95e521627a113c90 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Sun, 16 Jul 2017 22:30:38 +0800 Subject: [PATCH] fixed dialog fragment in preferences fragment crash on Android O --- .../twidere/preference/MultiSelectListPreference.java | 2 +- .../twidere/preference/iface/IDialogPreference.java | 10 ---------- .../twidere/preference/iface/IDialogPreference.kt | 10 ++++++++++ 3 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 twidere/src/main/java/org/mariotaku/twidere/preference/iface/IDialogPreference.java create mode 100644 twidere/src/main/kotlin/org/mariotaku/twidere/preference/iface/IDialogPreference.kt diff --git a/twidere/src/main/java/org/mariotaku/twidere/preference/MultiSelectListPreference.java b/twidere/src/main/java/org/mariotaku/twidere/preference/MultiSelectListPreference.java index eb2509acf..b5d972d01 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/preference/MultiSelectListPreference.java +++ b/twidere/src/main/java/org/mariotaku/twidere/preference/MultiSelectListPreference.java @@ -56,7 +56,7 @@ abstract class MultiSelectListPreference extends DialogPreference implements IDi public void displayDialog(PreferenceFragmentCompat fragment) { final MultiSelectListDialogFragment df = MultiSelectListDialogFragment.newInstance(getKey()); df.setTargetFragment(fragment, 0); - df.show(fragment.getChildFragmentManager(), getKey()); + df.show(fragment.getFragmentManager(), getKey()); } protected abstract boolean[] getDefaults(); diff --git a/twidere/src/main/java/org/mariotaku/twidere/preference/iface/IDialogPreference.java b/twidere/src/main/java/org/mariotaku/twidere/preference/iface/IDialogPreference.java deleted file mode 100644 index 1ebfb7614..000000000 --- a/twidere/src/main/java/org/mariotaku/twidere/preference/iface/IDialogPreference.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.mariotaku.twidere.preference.iface; - -import android.support.v7.preference.PreferenceFragmentCompat; - -/** - * Created by mariotaku on 16/3/13. - */ -public interface IDialogPreference { - void displayDialog(PreferenceFragmentCompat fragment); -} diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/preference/iface/IDialogPreference.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/preference/iface/IDialogPreference.kt new file mode 100644 index 000000000..51feeae26 --- /dev/null +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/preference/iface/IDialogPreference.kt @@ -0,0 +1,10 @@ +package org.mariotaku.twidere.preference.iface + +import android.support.v7.preference.PreferenceFragmentCompat + +/** + * Created by mariotaku on 16/3/13. + */ +interface IDialogPreference { + fun displayDialog(fragment: PreferenceFragmentCompat) +}