Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Android webview show "Next" in keyboard only if type="number" and not with type="text"?

I have a form with a few input fields. So I want to navigate between the fields with the next button but that just works when the input field type is "number". With type="text" it doesn't!

Is this a bug in Android 3.2.1?

My input fields are like that:

<input type="text" name="..." .... /> --> keyboard "Go"
<input type="text" name="..." .... /> --> keyboard "Go"
<input type="number" name="..." .... /> --> here it shows the "Next" button on the keyboard
<input type="text" name="..." .... /> --> keyboard "Go"
like image 835
user930141 Avatar asked Oct 12 '11 15:10

user930141


People also ask

Which of the following is enabled by default in Android WebView?

The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. It does not include any features of a fully developed web browser, such as navigation controls or an address bar. All that WebView does, by default, is show a web page.

Is Android WebView deprecated?

This interface was deprecated in API level 12. This interface is now obsolete.

Which method can be used to retrieve web setting in Android?

Configuring WebView Settings with WebSettings getSettings() object if a WebView is already destroyed. You can retrieve WebSettings with WebView. getSettings() API.

How do I close WebView on Android?

Add a close button and on its click set: webview. setVisibility(View. INVISIBLE); webview.


1 Answers

DennisA is right for Android 4.0 and below.

In short this is not a bug but sadly how google implemented it (I would prefer a consistent GO for all those keys so you can prevent the default action in JavaScript).

With Android 4.1 (JellyBean), you can change the default behavior by extending WebViewInputConnection: https://github.com/android/platform_frameworks_base/blob/master/core/java/android/webkit/WebViewClassic.java#L379

(hackery involved)

like image 135
Jon Avatar answered Oct 20 '22 02:10

Jon