Puede que esto ayude, (no puedo probarlo ahora mismo), pero si entiendo su pregunta igual esto le ayuda, si usted tiene una clase MyDialogPreference
extends de DialogPreference
cuenta con este metodo:
/**
* Shows the dialog associated with this Preference. This is normally initiated
* automatically on clicking on the preference. Call this method if you need to
* show the dialog on some other event.
*
* @param state Optional instance state to restore on the dialog
*/
protected void showDialog(Bundle state) {
UPDATE: O lo que quiere es algo asi como startPreferencePanel
public void onClick(View v) {
doAction((Integer) v.getTag());
}
.
private void doAction(int action) {
PreferenceActivity pa = (PreferenceActivity)getActivity();
switch (action) {
case ACTION_DISPLAY_SETTINGS:
pa.startPreferencePanel(DisplaySettings.class.getName(), null,
R.string.display_settings_title, null, null, 0);
break;
case ACTION_WIFI_SETTINGS:
pa.startPreferencePanel(WifiSettings.class.getName(), null,
R.string.wifi_settings, null, null, 0);
break;
case ACTION_BLUETOOTH_SETTINGS:
pa.startPreferencePanel(BluetoothSettings.class.getName(), null,
R.string.bluetooth_settings, null, null, 0);
break;
case ACTION_FORCE_STOP:
killProcesses();
break;
}
}
Dentro del directorio settings
en el link puedes mirar las class DisplaySettings
y demas para ver se adapta a lo que buscas.
Variacion sin click
public void llamada(int testNoClick) {
doAction(testNoClick);
}
.
private void doAction(int action) {
PreferenceActivity pa = (PreferenceActivity)getActivity();
switch (action) {
case 1:
pa.startPreferencePanel(DisplaySettings.class.getName(), null,
R.string.display_settings_title, null, null, 0);
break;
case 2:
pa.startPreferencePanel(WifiSettings.class.getName(), null,
R.string.wifi_settings, null, null, 0);
break;
case 3:
pa.startPreferencePanel(BluetoothSettings.class.getName(), null,
R.string.bluetooth_settings, null, null, 0);
break;
}
}
http://www.programcreek.com/java-api-examples/index.php?source_dir=android_packages_apps-master/Settings/src/com/android/settings/fuelgauge/PowerUsageDetail.java