使用Webview时在Android中禁用“开始"按钮表单提交

问题描述:

我正在开发一个Android应用程序,并使用WebView将表单嵌入到我的应用程序中.我的问题是android有软键盘,当用户在此键盘上按"go"时,它将提交表单.如何防止这种情况发生?我在Google上进行了强力搜索,但没有找到任何解决方案.

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.

好的,与此同时,我得到了一个非常简单的解决方案: 在清单XML中:

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.