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...

Hitesh Patel
  • 2,798
  • 2
  • 30
  • 62
Noundla Sandeep
  • 3,289
  • 5
  • 26
  • 55
  • 1
    possible duplicate of [How to close/hide the Android Soft Keyboard?](http://stackoverflow.com/questions/1109022/how-to-close-hide-the-android-soft-keyboard) – Adil Soomro Apr 12 '12 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... – Noundla Sandeep Apr 12 '12 at 11:02
  • see this post http://stackoverflow.com/a/1109108/985143 – Zaz Gmy Apr 12 '12 at 10:16
  • I am unable to get the solution from that link... still soft keyboard is visible when i click on edittext... – Noundla Sandeep Apr 12 '12 at 11:12
  • You might find [this article](http://developer.android.com/resources/articles/on-screen-inputs.html) helpful, from the Android Developers site. Let me know if it doesn't answer your question. – breadbin Apr 12 '12 at 10:14
  • possible duplicate of [how to hide soft keyboard on android after clicking outside EditText?](http://stackoverflow.com/questions/4165414/how-to-hide-soft-keyboard-on-android-after-clicking-outside-edittext) – mpromonet Mar 03 '15 at 21:50

3 Answers3

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?

Community
  • 1
  • 1
Sarim Sidd
  • 2,146
  • 1
  • 18
  • 31
  • 1
    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;' – Noundla Sandeep Apr 12 '12 at 11:27
  • without @Noundla 's comment the editbox won't be focusable on touch – Alon Kogan Apr 18 '17 at 23:59
1

Set EditText widget's inputType to null like this,

editTExt.setInputType(TYPE_NULL);
Hitesh Patel
  • 2,798
  • 2
  • 30
  • 62
ngesh
  • 13,044
  • 4
  • 41
  • 59
0

paste below code in your xml file under edittext tag

android:textIsSelectable="true"
Amol Suryawanshi
  • 1,880
  • 17
  • 27