Hi, I'm building CM 9 from source. I'm adding some features. I need to add a string to the class settings because I want to store a preference. It's just a simple checkbox.
I've seen at https://github.com/CyanogenMod/andr...android/settings/cyanogenmod/PowerWidget.java that I have to assign the value 0 or 1.
This is the method I'm interested in:
It's exactly what I want to do, but I need to add a string to Setting.System, for example Settings.System.X_Y_Z, Where do I have to write X_Y_Z? I know there is a class called Settings that has written all these strings, but it's in the "out" folder and the settings app doesn't compile beacuse the variable X_Y_Z can not be found. Anybody knows where should I add the string X_Y_Z?
EDIT: Solved.
I've seen at https://github.com/CyanogenMod/andr...android/settings/cyanogenmod/PowerWidget.java that I have to assign the value 0 or 1.
This is the method I'm interested in:
Code:
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference == mPowerWidgetHapticFeedback) {
int intValue = Integer.parseInt((String) newValue);
Settings.System.putInt(getActivity().getApplicationContext().getContentResolver(),
Settings.System.EXPANDED_HAPTIC_FEEDBACK, intValue);
return true;
}
return false;
}
EDIT: Solved.
Last edited: