android timepicker on cancel
I use standart android's timepicker:
...
showDialog(TIMEPICKER);
...
private TimePickerDialog.OnTimeSetListener mTimeSetListener =
new TimePickerDialog.OnTimeSetListener() {
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
//code;
}
};
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case TIMEPICKER:
return new TimePickerDialog(this,mTimeSetListener, 0, 0, true);
}
return null;
}
everything is fine,开发者_C百科 but how can i catch cancel button to perform some code ?
setOnCancelListener or try even the setOnDismissListener.
精彩评论