0

I want to hide soft keyboard on EditText even on 'click' also. I mean to say there should not be visible soft keyboard in my activity, because I am having own keyboard to enter data. Please help me... Thanks...

6
  • You might find this article helpful, from the Android Developers site. Let me know if it doesn't answer your question. Commented Apr 12, 2012 at 10:14
  • see this post stackoverflow.com/a/1109108/985143 Commented Apr 12, 2012 at 10:16
  • 1
    possible duplicate of How to close/hide the Android Soft Keyboard? Commented Apr 12, 2012 at 10:20
  • @Adil Soomro, I am unable to get the solution from that link... still soft keyboard is visible when i click on edittext... Commented Apr 12, 2012 at 11:02
  • I am unable to get the solution from that link... still soft keyboard is visible when i click on edittext... Commented Apr 12, 2012 at 11:12

3 Answers 3

3
 editText_input_field.setOnTouchListener(otl);

 private OnTouchListener otl = new OnTouchListener() {
 public boolean onTouch (View v, MotionEvent event) {
        return true; // the listener has consumed the event
}
};

source : how to block virtual keyboard while clicking on edittext in android?

Sign up to request clarification or add additional context in comments.

2 Comments

this is nice, and here we have to get focus on the specified view thats why we have to get the request on that. so Its better to add ((EditText)v).requestFocus() above `return true;'
without @Noundla 's comment the editbox won't be focusable on touch
1

Set EditText widget's inputType to null like this,

editTExt.setInputType(TYPE_NULL);

3 Comments

@noundla.. its a constant in InputType class.. try InputYpe.TYPE_NULL
ok.. it is worked fine for the only the edittext which has focus already.. If i move to another edittext then the softkeyboard is coming...
yup.... I have already set that for all views.. anyway i got solution using the below answer which i tick accepted answer.
0

paste below code in your xml file under edittext tag

android:textIsSelectable="true"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.