Attributes are passed to the constructor of your user preference:
Check the AttributeSet class for other ways to subtract a value, for example:
public TimeDialogPreference(Context context, AttributeSet attrs) {
super(context, attrs);
for (int i=0;i<attrs.getAttributeCount();i++) {
String attr = attrs.getAttributeName(i);
String val = attrs.getAttributeValue(i);
if (attr.equalsIgnoreCase("step")) {
Log.i("TimeDialogPreference", "step = "+val);
}
}
}
slund source
share