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...
Asked
Active
Viewed 6,963 times
0

Hitesh Patel
- 2,868
- 2
- 33
- 62

Noundla Sandeep
- 3,334
- 5
- 29
- 56
-
1possible 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 Answers
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,166
- 2
- 22
- 31
-
1this 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,868
- 2
- 33
- 62

ngesh
- 13,398
- 4
- 44
- 60
-
@noundla.. its a constant in **InputType** class.. try **InputYpe.TYPE_NULL** – ngesh Apr 12 '12 at 11:08
-
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... – Noundla Sandeep Apr 12 '12 at 11:14
-
yup.... I have already set that for all views.. anyway i got solution using the below answer which i tick accepted answer. – Noundla Sandeep Apr 12 '12 at 11:25
0
paste below code in your xml file under edittext tag
android:textIsSelectable="true"

Amol Suryawanshi
- 2,108
- 21
- 29