目前我有这样的代码:
back.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
//DO STUFF
return true;
}
});
music.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
//DO OTHER STUFF
return false;
}
});
sound.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
//DO MORE STUFF
return true;
}
});
是否有可能以某种方式优化这段代码?提前致谢。