How to open nested child PreferenceScreen in Android

I have a PreferenceScreen, which is defined in XML, which supports all the settings of my application. This preference screen also has a PreferenceScreen child screen nested within it. My implementation class is called PreferencesActivity. I know that I can open the main settings window through startActivity (new Intent (this, PreferencesActivity.class)); but how do I start opening a PreferenceScreen child with intent?

+5
android android-preferences
May 20 '10 at 3:34
source share
2 answers

I researched some time on this topic for my Theft Aware project ( http://www.theftaware.com ) (a bit of advertising ... :) and I found a solution:

PreferenceScreen screen = getPreferenceScreen(); // gets the main preference screen screen.onItemClick(null, null, INDEX , 0); // click on the item 

where INDEX is the position of the item you want to open on the screen

+4
Jun 30 '10 at 14:26
source share

see this question for a more general solution based on the Reinhardt idea finally!

+3
Feb 01 '11 at 23:12
source share



All Articles