时间选择器
Calendar now = Calendar.getInstance();
now.set(Calendar.YEAR, 1985);
new DatePicker(MainActivity.this, true, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DATE))
.setOnDateTimeSetListener(new DatePicker.OnDateTimeSetListener() {
@Override
public void onDateTimeSet(DatePicker picker) {
birthdayTime = picker.getTime();
tvDataPicker.setText(formatter.format(birthdayTime.getTime()));
}
})
.show();
new DatePicker(MainActivity.this, false, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DATE), true)
.setOnDateTimeSetListener(new DatePicker.OnDateTimeSetListener() {
@Override
public void onDateTimeSet(DatePicker picker) {
birthdayTime = picker.getTime();
tvDataPicker.setText(formatter.format(birthdayTime.getTime()));
}
})
.show();