OptimusCrime
OptimusCrime

Reputation: 14863

Soft keyboard hides parts of fullscreen webview

I am developing a native Android app that is a wrapper for a webpage. It works pretty well, but there is an issue where the soft keyboard (Android keyboard) appears over the bottom of the webview, which makes it impossible to see what you are writing if you are trying to fill out something near the bottom of the webview.

Please see image below. Here I've clicked a textarea that is impossible to reach while the keyboard is open:

enter image description here

The code for this view is:

<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" android:paddingLeft="0dp"
    android:paddingRight="0dp"
    android:paddingTop="0dp"
    android:paddingBottom="0dp" tools:context=".PetpulseMainActivity">

    <WebView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/petpulseWebView" />
</RelativeLayout>

I've tried switching the RelativeLayout with ScrollView and other approaches I've found, but for some reason the keyboard is always rendered on top of the view.

AndroidManifest.xml:

<activity
    android:name=".PetpulseMainActivity"
    android:label="@string/app_name"
    android:screenOrientation="portrait">
         [...]
</activity>

Upvotes: 3

Views: 3184

Answers (1)

vinitius
vinitius

Reputation: 3274

It's a known bug as refered in :

https://code.google.com/p/android/issues/detail?id=5497

To avoid it, remove the FullScreen theme of your activity

Update:

From FLAG_FULLSCREEN

Window flag: hide all screen decorations (such as the status bar) while this window is displayed. This allows the window to use the entire display space for itself -- the status bar will be hidden when an app window with this flag set is on the top layer. A fullscreen window will ignore a value of SOFT_INPUT_ADJUST_RESIZE for the window's softInputMode field; the window will stay fullscreen and will not resize.

Upvotes: 5

Related Questions