I'm calling a MaterialDatePicker like this in Android:
MaterialDatePicker.Builder<Pair<Long, Long>> builder = MaterialDatePicker.Builder.dateRangePicker();
CalendarConstraints.Builder constraintsBuilder = new CalendarConstraints.Builder();
builder.setCalendarConstraints(constraintsBuilder.build());
int dialogTheme = resolveOrThrow(getContext(), R.attr.materialCalendarTheme);
builder.setTheme(dialogTheme);
MaterialDatePicker<?> picker = builder.build();
picker.show(getFragmentManager(), picker.toString());
the library is:
dependencies {
implementation 'com.google.android.material:material:1.2.0-alpha01'
}
How can I get the selected date of this calendar? I can't find any listener like onDateSet
or OnDateSetListener
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…