How do I implement the onClick method for a DialogPreference?

by Nick » Sat, 22 Aug 2009 01:53:28 GMT

Sponsored Links
 I have implemented onSharedPreferenceChanged in my Preference
Activity, which works for other preference settings but it won't get
triggered when I click on the DialogPreference.  I have also tried to
add set the OnPreferenceClickListener to the DialogPreference, which
also works, but this gets triggered as soon as I click on the
preference screen and not on one of the buttons in the actual dialog

I would like to somehow implement the onClick method but don't know
where to do this.

public class Preferences extends PreferenceActivity implements
OnSharedPreferenceChangeListener {

        private static final String LOG = "test";
        private DialogPreference mfactory;

        protected void onCreate(Bundle savedInstanceState) {

            // Load the preferences from an XML resource

            mfactory = (DialogPreference)findPreference
DialogPreference.OnPreferenceClickListener() {

                        public boolean onPreferenceClick(Preference preference) 
                                Log.i(LOG, "onPreferenceClick1 entered");

                                // TODO Auto-generated method stub
                                return false;

        protected void onResume() {
                Log.i(LOG, "onResume entered");

                // Add a Listener

        protected void onPause() {
                Log.i(LOG, "onPause entered");

                // Remove the Listener

        public void onSharedPreferenceChanged(SharedPreferences
sharedPreferences, String key) {
                Log.i(LOG, "onSharedPreferenceChanged entered");



Other Threads

1. Accessing sdcard filesystem through dev machine filesystem - possible?

Is it possible to access the filesystem of an sdcard image through
something like Windows Explorer? i.e. mount the sdcard as a drive or
web folder or something.

I have some xml files stored on my sdcard image which I frequently
want to edit. Ideally I would like to be able to edit these files
directly using my fave xml editor (either through the filesystem or

But is this possible? If not, is the only alternative to pull the xml
file from the sdcard to the dev machine filesystem, edit and the push
it back?

2. Forward porting USB OTG capability on Dell Streak

Hash: SHA1

Hi there,

I hope this is the correct list for my question, if not please advise
which list would be better suited.

Some people found out that the Dell Streak supports USB OTG.

however this is only true for the Eclair version. This capability was
apparently removed from the Froyo version for unknown reasons.

I would like to be able to use this on Froyo.

I've looked at the kernel sources (disclaimer: I am not a kernel
hacker) made available be Dell at

It appears to me that the modifications that led to the loss of
functionality are in arch/arm/mach-msm/board-qsd8x50_austin.c

What I would like to do is to port the USB OTG related code from
Eclair to Froyo.

This is difficult since:

1) I am no kernel hacker (I've tried copying some of the code
differences, but while the kernel compiled it didn't boot)

2) The USB layer seems to have somewhat changed between the kernel
versions that served as bases for both Dell tarballs. Apparently,
2.6.29 served as the base for Eclair and 2.6.32 as the base for the
Froyo vesion. In addition, I've read that the code for the Dell
kernels was lifted from different kernel versions, so the drivers
might be again from different versions.

Can I get some advice on how to proceed best?

(besides downgrading to Eclair, of course ;)

Version: GnuPG v1.4.10 (GNU/Linux)



3. Call AnotherActivity

4. How to detect walking

5. ProgressDialog Theme - TextColor or Background but not both

6. Orientation change problem.

7. Out of memory - despite being way under 16mb