Hello,

I'm having a hard time how to open a preference dialog from code.

Let's say I have a ListPreference with the key "abc" defined in XML.
When the user navigates through the preferences and clicks on that
ListPreference, a dialog pops up and the user can select it. Is there
any way to open that dialog from code, e.g. simulating that the user
opens preferences and clicks on the item?

I've tried several ways, eg.

( (android.preference.DialogPreference)
prefMgr.findPreference( "abc" )).showDialog(null);

but with no result. (This does not work because it is a protected
method).

Of course I gut build my own dialog which looks like the dialog of the
preference and does the same, but that would be building the same
thing again and I had to track the changes done to either dialog/
preference to update the other.

StackOverflow does not seem to have an answer, see eg [1] or [2],
maybe here's someone that can tell if it's possible (or at least say
it is not)?

[1] 
http://stackoverflow.com/questions/4805896/how-to-open-a-android-dialogpreference-created-with-xml-from-code
[2] 
http://stackoverflow.com/questions/4659197/programmatically-perform-click-in-android-preferenceactivity

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to