EditText inside TextInputLayout onclick requires 2 click ?! Android : <p>I am simply trying to have an onlick listen on an Edit text inside a TextInputLayout. It works but I need to click on the EditText twice for it to trigger I dont understand why. Here is my code:</p>

<p>xml:</p>

<pre><code>  &lt;android.support.design.widget.TextInputLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"&gt;

        &lt;EditText
            android:id="@+id/start_date"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="Starting Date*: "
            android:inputType="textPersonName" /&gt;
    &lt;/android.support.design.widget.TextInputLayout&gt;
</code></pre>

<p>Listenner:</p>

<pre><code>   private void setListenners() {
        EditText startDate = (EditText) mView.findViewById(R.id.start_date);
        startDate.setOnClickListener(new View.OnClickListener() {
            @RequiresApi(api = Build.VERSION_CODES.N)
            @Override
            public void onClick(View v) {
                Calendar mcurrentDate=Calendar.getInstance();
                int mYear = mcurrentDate.get(Calendar.YEAR);
                int mMonth = mcurrentDate.get(Calendar.MONTH);
                int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH);

                DatePickerDialog mDatePicker=new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() {
                    @Override
                    public void onDateSet(DatePicker datePicker, int year, int month, int day) {
                        Log.d("DEBUG", "year: " + year + " month: " + month + " day: " + day);
                    }
                },mYear, mMonth, mDay);
                mDatePicker.show();
            }
        });
    }
</code></pre>
