When testing a android.preference.PreferenceActivity, I get the following warning:
warning: [deprecation] getFragmentManager() in Activity has been deprecated
That is how I obtain a handle to the current PreferenceFragment
:
FragmentManager fm = this.mActivity.getFragmentManager();
this.currentFragment = (PreferenceFragment) fm.getFragments().get(1);
Using FragmentActivity.getSupportFragmentManager()
is obviously not an option.
I've found PreferenceFragmentCompat, which would replace the deprecated PreferenceFragment
.
But is there any androidx
replacement for the PreferenceActivity
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…