I have added a setOnTouchListener to EditText in order to scroll the screen when the user click on it. It works, but in the first click it scroll and only in the second click the EditText get focused and open the soft keyboard. How can I make the EditText get focused in the first click and not only in the second?
et_email = (EditText) view.findViewById(R.id.editEmail);
et_email.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
ScrollView scrollView = (ScrollView) getView().findViewById(R.id.ScrollViewSendDetails);
scrollView.smoothScrollTo(0, et_email.getBottom() + 200);
return false;
}
});
btw I tried to add this, but it doesn't help