I'm trying to migrate my old auto-generated (from the activity gallery in Android Studio) settings activity to AndroidX
. Unfortunately, I can't find any info on how to do that. The official docs aren't very helpful, since they assume you already have all the code in place to add your preference fragments and XML
.
I tried switching the old PreferenceScreen
to the AndroidX
one, and PreferenceFragment
to PreferenceFragmentCompat
, but that only results in a runtime exception.
Does anyone know how to perform such migration?
To answer my own question - it's not worth migrating existing preference activity. It's faster to make an empty one and manually set fragments, as in the docs. Everything seems to be working in such case, and most of previous code is unused.