开发者

Disabling 'go' button form submission in Android when using webview

I'm developing an Android application and I use a WebView to embed forms into my application. My problem is that android has a soft keyboard and when the user presses '开发者_运维问答go' on this keyboard it submits the form. How can I prevent this from happening? I did a power search on google but I did not find any solutions.


Ok in the meantime i got a very simple solution: In the manifest XML:

<activity android:name="..."
...
android:imeOptions="actionSend|flagNoEnterAction"
...
</activity>

This way the 'go' button got replaced by 'done' and it hides the keyboard.


Create a WebViewClient class and register it with your WebView.

This post discusses this: Android - how to intercept a form POST in android WebViewClient on API level 4

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜