FragmentManager is deprecated. Is there an alternative or what can I do now?
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocomplet
If you're displaying a DialogFragment over a PreferenceFragment (specifically an android.preference.PreferenceFragment not the class from the Support Preference library), then you will see this warning.
Approximately June 2018, Google deprecated the PreferenceFragment and all its associated methods like getFragmentManager(). You probably already know that getSupportFragmentManager() cannot be used on the PreferenceFragment anyway, as it's a special exception.
The recommended approach now is to use the PreferenceFragmentCompat from the AndroidX Jetpack library or from the Preference Support library:
implementation "androidx.preference:preference:1.0.0"
You can see available versions here: https://maven.google.com -> Search for "preference"
More info here: Android- deprecated method warning regarding PreferenceActivity
Be aware that migrating to PreferenceFragmentCompat may be a lengthy and difficult task, especially if you have custom Preference classes. More info: