安卓原生的日期选择器
bt2.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
if (cd!=null)cd=null;
cd =Calendar.getInstance();
DatePickerDialog datePickerDialog = new DatePickerDialog(MainActivity.this, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
cd.set(Calendar.YEAR,year);
cd.set(Calendar.MONTH,month);
cd.set(Calendar.DAY_OF_MONTH,dayOfMonth);
}
}, cd.get(Calendar.YEAR), cd.get(Calendar.MONTH), cd.get(Calendar.DAY_OF_MONTH));
datePickerDialog.show();
}
});
最简单的教养,就是适当地回避别人的难堪。