jaswanth03
2/23/2018 - 11:39 AM

Edit Text on click listener for the first time

Default working of EditText: On first click it focuses and on second click it handles onClickListener so you need to disable focus. Then on first click the onClickListener will handle.

 etComment.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if(hasFocus)
                {
                    etComment.callOnClick();
                }
            }
        });
        etComment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                cvMemeCard.setVisibility(GONE);
                //do what ever you want when edit text is clicked here
            }

        });