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.breadbin– breadbin2012-04-12 10:14:36 +00:00Commented Apr 12, 2012 at 10:14
-
see this post stackoverflow.com/a/1109108/985143Zaz Gmy– Zaz Gmy2012-04-12 10:16:05 +00:00Commented Apr 12, 2012 at 10:16
-
1possible duplicate of How to close/hide the Android Soft Keyboard?Adil Soomro– Adil Soomro2012-04-12 10:20:54 +00:00Commented 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...Sandeep– Sandeep2012-04-12 11:02:51 +00:00Commented 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...Sandeep– Sandeep2012-04-12 11:12:40 +00:00Commented Apr 12, 2012 at 11:12
|
Show 1 more comment
3 Answers
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?
2 Comments
Sandeep
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;'Alon Kogan
without @Noundla 's comment the editbox won't be focusable on touch
Set EditText widget's inputType to null like this,
editTExt.setInputType(TYPE_NULL);
3 Comments
ngesh
@noundla.. its a constant in InputType class.. try InputYpe.TYPE_NULL
Sandeep
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...
Sandeep
yup.... I have already set that for all views.. anyway i got solution using the below answer which i tick accepted answer.