Why Is Android Webview Refusing User Input

Why is Android WebView refusing user input?

Turns out that it was apparently the WebView not having focus that was the issue.

I discovered that using the arrow keys to get focus on the textboxes caused them to work, so I theorised that there was an issue somewhere with something not having focus, most likely the WebView not having focus. Sure enough, adding the following line seemed to fix the problem:

webView.requestFocus(View.FOCUS_DOWN);

I'm still at a loss to explain exactly why the issue occurred in the first place - the textboxes should work whether they receive focus from being tapped upon or through being "arrowed" to - but at least I have a solution that appears to work.

Thanks for your input wf.

Android WebView refuse user input & touches

just add this line :

webSettings.setUseWideViewPort(true);

Android - Email InputField is not taking user input

Your keyboard is not supporting that field in WebView. So you need to force WebView to open default keyboard.

You have to customize WebView by extending WebView class. Override its onCreateInputConnection() method:

import android.content.Context
import android.util.AttributeSet
import android.view.inputmethod.BaseInputConnection
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputConnection
import android.webkit.WebView

class QWebView : WebView
{
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int, privateBrowsing: Boolean) : super(context, attrs, defStyleAttr, privateBrowsing)

override fun onCreateInputConnection(outAttrs: EditorInfo?): InputConnection
{
return BaseInputConnection(this, false)
}
}

In Android Webview loaded URL in which EditText is not getting focus and keyboard is not launching

Found the issue :

<WebView
android:id="@+id/common_webview_id"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"></WebView>

The problem was "focusableInTouchMode" attribute value was set to

"false" i.e android:focusableInTouchMode="false" and it should be
"true" edit text to gain focus.

Virtual keyboard overlapping input in webview

This was a purely Genero issue that has to my knowledge has been fixed since.



Related Topics



Leave a reply



Submit