I am designing my own keyboard, so i dont want the default keyboard to appear.
I am able to achieve this, but the focus on selection is missing.
How can i have the focus but disable the Keyboard alone on EditText
in Android?
I am designing my own keyboard, so i dont want the default keyboard to appear.
I am able to achieve this, but the focus on selection is missing.
How can i have the focus but disable the Keyboard alone on EditText
in Android?
add this listener for edittext:
edit_Text.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if(hasFocus){
hideSoftKeyboard();
}
}
});
and add this method to activity:
public static void hideSoftKeyboard() {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), 0);
}