Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android keyboard not showing when clicking on input in webview

I have a custom webview implemented in my android app. If I touch an input or an text area inside this webview the soft keyboard doesn't show up. I have not overriden any touchlisteners in my webview nor did I change anything in my manifest. Can anyone help me figure out why the keyboard doesn't show?

My layout code:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipeRefreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <nl.AEGEE.enschede.android.AEGEEWebView
            android:id="@+id/webView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </android.support.v4.widget.SwipeRefreshLayout>

    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleHorizontal"
        android:progressTint="@color/aegee_blue"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="-6dp"
        android:layout_alignParentTop="true" />

</RelativeLayout>
like image 760
Victor Avatar asked Jan 05 '16 23:01

Victor


1 Answers

Please try to add these lines to your webview in the XML file.

android:focusable="true"
android:focusableInTouchMode="true"

Hope it helps.

like image 187
Kristo Avatar answered Sep 22 '22 06:09

Kristo