When I implement this. I catch this event multiple time.
Would you please provide solution.
private EditText mDateOfBirth;
mDateOfBirth = (EditText) findViewById(R.id.sign_up_date_of_birth);
mDateOfBirth.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
Calendar now = Calendar.getInstance();
DatePickerDialog dpd = DatePickerDialog.newInstance(
NewSignUpActivity.this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH)
);
dpd.show(getFragmentManager(), "Datepickerdialog");
dpd.setMaxDate(now);
}
return false;
}
});
1 Answer(s)