Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • setOnTouchListener call multiple times

    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 1.25k
    Answer it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: