I write an android app
I set an editText.setOnClickListener(...)
but i see that when the user clicks, the soft-keyboard is opened and only
when the user clicks on a keyboard key - the onClick()
is called.
how to catch the click before the soft keyboard is opened?
I want to avoid the keyboard opening.
here is my code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.phone_login);
initMembers();
setOnClickListeners();
initFieldsTexts();
setKeyboardVisibilityListener();
}
private void setOnClickListeners() {
mPhoneNumberField.setInputTextOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
setResult(RESULT_CANCELED);
finish();
}
});
}
and:
public class PhoneLoginFillInField extends LinearLayout {
..
public void setInputTextOnClickListener(OnClickListener onClickListener)
{
mInputText.setOnClickListener(onClickListener);
}
during debugging i see this line is called twice
mPhoneNumberField.setInputTextOnClickListener(new OnClickListener() {
though it's called only from onCreate and there setOnClickListeners();
is called once
Set an onTouchListener to the EditView. Remember to return true to avoid the event propagation.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments