private void showDatePicker() {
    Calendar now = Calendar.getInstance();
    DatePickerDialog dpd =
        DatePickerDialog.newInstance(
            this, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH));

    dpd.show(getFragmentManager(), this.getResources().getString(R.string.date_of_birth));
  }
 public void transactionDateRangePickerFragment(DatePickerDialog.OnDateSetListener listener) {
   Calendar now = Calendar.getInstance();
   DatePickerDialog dpd =
       DatePickerDialog.newInstance(
           listener,
           now.get(Calendar.YEAR),
           now.get(Calendar.MONTH),
           now.get(Calendar.DAY_OF_MONTH));
   dpd.show(getFragmentManager(), "DatePicker");
 }
示例#3
0
  @OnClick(R.id.date_of_birth)
  void DatePicker() {
    now = Calendar.getInstance();
    com.wdullaer.materialdatetimepicker.date.DatePickerDialog datePickerDialog;

    datePickerDialog =
        com.wdullaer.materialdatetimepicker.date.DatePickerDialog.newInstance(
            this, defaultYear, defaultMonth, defaultDate);
    datePickerDialog.show(getActivity().getFragmentManager(), DATE_TAG);
  }
 @Override
 public void onClick(View view) {
   if (view == etDate) {
     Calendar now = Calendar.getInstance();
     DatePickerDialog dpd =
         DatePickerDialog.newInstance(
             ThemGiaoDichActivity.this,
             now.get(Calendar.YEAR),
             now.get(Calendar.MONTH),
             now.get(Calendar.DAY_OF_MONTH));
     dpd.show(getFragmentManager(), "Datepickerdialog");
   }
   if (view == btnSave) {
     setData();
     finish();
   }
   if (view == etGroup) {
     Intent intent = new Intent(ThemGiaoDichActivity.this, DanhMucActivity.class);
     startActivityForResult(intent, 2);
   }
 }