Skip to content

Instantly share code, notes, and snippets.

@sharifulislam52
Last active March 1, 2018 15:50
Show Gist options
  • Save sharifulislam52/ce1a9f87386c3071791039c70768399f to your computer and use it in GitHub Desktop.
Save sharifulislam52/ce1a9f87386c3071791039c70768399f to your computer and use it in GitHub Desktop.
static final int dialog_id = 0;
int hour_x, minute_x;
@Override
protected Dialog onCreateDialog(int id){
if(id == dialog_id) {
return new TimePickerDialog(your_activity.this, getTime, hour_x, minute_x, true);
}
return null;
}
protected TimePickerDialog.OnTimeSetListener getTime = new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int i, int i1) {
hour_x = i;
minute_x = i1;
// what want to do
}
};
// dialog_id, your_activity, getTime, hour_x, minute_x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment