0

I don't know that's possible or not, my question is : Is there anyway to hide keyboard in Android 4.0.4 using jQuery or Javascript?

Because I developed application that using mobile device Android.

<input type="text" name="input" id="input"/>

As we know, when We focus to textbox, soft keyboard will appear.

Any advice ? Please help.

Asean Jazz
  • 115
  • 1
  • 2
  • 14

3 Answers3

1

This can be done using Android Code programatically like fromInput is an EditText if you put the following code in onCreate() method, keyboard will not appear on EditText

private EditText fromInput
fromInput = (EditText) findViewById(R.id.fromInput);
fromInput.setInputType(InputType.TYPE_NULL);

Consider the following SO Question for hiding the keyboard using javscript

Community
  • 1
  • 1
Ashok
  • 1,221
  • 11
  • 17
0

Try this, the soft-keyboard won't popup for the myEditText.

myEditText = (EditText) findViewById(R.id.fromInput);    
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);    
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
Ashok
  • 1,221
  • 11
  • 17
Sino
  • 846
  • 7
  • 20
0

If you really dont want to show keyboard on focus of textox, Simply use a DIV and using css give it a style so it looks like textbox. OR mark it as readonly if u dont want user to edit it. readonly="true"

narangrajeev81
  • 359
  • 3
  • 11