Status Update
Comments
bp...@gmail.com <bp...@gmail.com> #2
My dependencies:
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.gms:play-services-wearable:17.1.0'
implementation 'com.google.android.material:material:1.4.0'
If I remove androidx.appcompat:appcompat:1.4.0
, the warning vanishes, so I imagine there's some transitive dependency on an older version of androidx.appcompat:appcompat
that doesn't have the warning.
ow...@google.com <ow...@google.com> #4
The upstream library is using @SuppressWarnings("deprecation")
, which I suppose you could probably use to suppress the warning you're getting.
As for doing fully the non-deprecated way, it is possible that would require overwriting/duplicating more functionality than you currently are and/or updates to the Preference library.
However, I suspect that FragmentManager is capable of handling Fragment subclasses. You should probably look for instructions on developer.android.com, stackoverflow, or similar.
pa...@gmail.com <pa...@gmail.com> #5
Looks like a duplicate of
Description
Artifact used: androidx.preference:preference
Version used: 1.1.1
Theme used: n/a
Devices/Android versions reproduced on: Pixel 6, SQ1D.211205.017.A1
I've extended to create a custom dialog.
androidx.preference.PreferenceDialogFragmentCompat
When showing the dialog from my . If I don't call
PreferenceFragmentCompat
-derived class'sonDisplayPreferenceDialog
method, I must callsetTargetFragment
setTargetFragment
and instead use the suggested alternative,setFragmentResultListener
, I trigger thisIllegalStateException
inPreferenceDialogFragmentCompat.java
How can I avoid using a deprecated function when the library itself is still using deprectaed ?
getTargetFragment