0

I've tried every method I've seen for disabling the softkeyboard in an android app when using a webview. Nothing works. Instead, I decided I'd use a custom softkeyboard http://www.fampennings.nl/maarten/android/09keyboard/index.htm (SO keeps giving me an Object object error when trying to format that link). Then I noticed that the last step is to register the edittexts...which a webview wouldn't be using.

At this point I'll take any solution I can get, I simply would like to have a custom keyboard for a calculator app that supports hex. If there's a way to make a custom softkeyboard work with a webview: I'll take that answer. If there's a way to completely disable the softkeyboard and I could just write one as part of the webview: that'd be great too.

2 Answers 2

1

Would it be fair to assume the only reason the keyboard is coming up is because you are using an input.

Instead, use a div, touch/click handlers on the element to work out when the user has tapped on it, then show your custom keyboard in the webview and set the innerHTML from the keyboard presses.

Through this, there is no reason the keyboard would show up.

Sign up to request clarification or add additional context in comments.

1 Comment

This appears to be the only solution, which I started working on last night shortly after posting this question. It's such a pain to do it this way, but it doesn't look like WebView has much android keyboard support so it's the only way.
0

Try
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
This is explained on:
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#softInputMode

Useful links: How to develop a soft keyboard for Android?
http://developer.android.com/guide/topics/text/creating-input-method.html

1 Comment

That code hides it initially, it won't keep it hidden. Nothing, apparently, keeps it hidden. I also don't want to make an optional IME that people have to enable. I want it forced on the app but not outside of it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.