I have PreferenceActivity with plenty of PreferenceCategories defined in it. If I have the android:key of a given category.
Is it possible programmatically to scroll the Activity to this category?
I know this is an old answered question, but I found a better way than iterating through all the categories.
PreferenceCategory myCat = (PreferenceCategory) findPreference("myKey");
int position = myCat.getOrder();
getListView().setSelection(position);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With