I am using phonegap to develop a web app for Android, and since I will have my own keypad in HTML, I need to disable android's system keyboard, preventing the it from showing up when the user clicks on any text input field. I don't want to use readonly input field or onblur()
since I would like to have the cursor in the text filed so user can move the cursor position while they're entering inputs.
So I want to completely disable Android's keyboard on default, I tried adding android:windowSoftInputMode="stateAlwaysHidden"
to manifest.xml
but this does not work.
I also try use a javascript interface from here, but there was a javascript-java bridge crash issue on Android 2.3.x.(link to issue). So I still don't have a good solution now. Please help.
Thank in advance for any help.
The Android system shows an on-screen keyboard—known as a soft input method—when a text field in your UI receives focus.
Okay, you've got a few options! You can try to disable the keyboard completely using:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
You could use something similar to the following link. I haven't dug through it very thoroughly (tl;dr) but he creates a custom view that extends from android.inputmethodservice.KeyboardView
and uses that instead.
Lastly (I'm not sure how much this would differentiate from the first one) you could create your own IME.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With