I'm building an android application and I have a pretty dumb question -
I've created a preference screen and put in it a list and a checkBox. Now I handled those just fine, using the 'key' attribute that is saved automatically.
My problem comes when I try using a si开发者_开发技巧mple Preference Item(they type that you just press it).
What is saved in SharedPreference when it's clicked? If nothing, how can I catch the click event?
I can't find an answer anywhere. Thanks a lot!
tofira,
You need to use setOnPreferenceClickListener() for that particular item.  See example:
Preference myPref = (Preference) findPreference("myPref");
myPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
    public boolean onPreferenceClick(Preference preference) {
    //handle action on click here
    }
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论