I have a TimePickerDialog preference with a "TimePreference" class which extends DialogPreference:
public class TimePreference extends DialogPreference{
...
private TimePicker picker=null;
...
public TimePreference(Context ctxt, AttributeSet attrs){
super(ctxt, attrs);
setPositiveButtonText(android.R.string.ok);
setNegativeButtonText(android.R.string.cancel);
}
@Override
protected View onCreateDialogView(){
picker=new TimePicker(getContext());
return(picker);
}
...
}
I would like to add a third button, which will set the preference to the current time and close the dialog, like this:

The question is, is there some way of doing this using TimePickers or should I make a custom AlertDialog?