I saw this post about picking time on positive click of the time picker from Material Design. I am struggling with doing it in Java.
My current codes:
final MaterialTimePicker materialTimePicker = new MaterialTimePicker.Builder()
.setTimeFormat(TimeFormat.CLOCK_24H)
.build();
pickTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
materialTimePicker.show(getSupportFragmentManager(), "fragment_tag");
}
});
I am thinking about writing something like materialTimePicker.addOnPositiveButtonClickListener(new MaterialPickerOnPositiveButtonClickListener<>())
, but I am not sure how to fill the blank. My goal is to get the hour and minutes from the time picker.