Android Soft-Key-Buttons hide view's content
<p>I'm having troubles with layouts being too large on Devices with Soft-Key-Buttons on Android:</p>

<p>Summing up, my question is why a layout, which is configured as <strong><em>"match_parent"</em></strong> has its View-bounds extended to the "real" bottom window bound, instead of just above the Soft-Key-Buttons?</p>

<p>Now to my specific problem:</p>

<p>While displaying a RelativeLayout (in a Fragment, if thats necessary to know) with a View <strong><em>layout_alignParentBottom="true"</em></strong> on any Device with Soft-Key-Buttons, the View is displayed "behind" the Soft-Key-Buttons.</p>

<p><a href="http://i.stack.imgur.com/6luE5.png" rel="nofollow">Image of the View on a Device without Soft-Key-Buttons (as it should be)</a></p>

<p><a href="http://i.stack.imgur.com/LluHC.png" rel="nofollow">Image of the View on a Device with Soft-Key-Buttons (the Button is "hiding" behind the Soft-Keys)</a></p>

<p>The RelativeLayout looks like this:</p>

<pre><code>&lt;RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg2"&gt;

    &lt;LinearLayout
        android:layout_marginTop="@dimen/settings_container_margin_top"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:orientation="vertical"&gt;

        &lt;!-- Some views --&gt;

    &lt;/LinearLayout&gt;

    &lt;at.eventdrivers.android.ui.MenuButton
        android:layout_width="250dp"
        android:layout_height="50dp"
        android:layout_gravity="center_horizontal"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        custom:btnText="@string/..." /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>As I'm quite new to Android Development and also have not done anything before with Fragments, the error could also be in the fragment-management, so I'm going to post this too:</p>

<p>The Activity, in which the fragment is shown, is configured in the AndroidManifest:</p>

<pre><code>&lt;activity
    android:name=".slidingmenu.SlidingHomeActivity"
    android:label="@string/app_name"
    android:logo="@mipmap/ic_launcher"
    android:theme="@style/AppBaseTheme"
    android:windowSoftInputMode="adjustResize"
    android:screenOrientation="portrait" &gt;
    &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.MAIN" /&gt;
        &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
    &lt;/intent-filter&gt;
&lt;/activity&gt;
</code></pre>

<p>The used FrameLayouts all have layout_width and layout_height set to match_parent.</p>

<p>Right now I'm using kind of a workaround with programmatically checking if the device is showing Soft-Key-Buttons, and if yes, setting the margin of this Button to a higher value:</p>

<pre><code>public static boolean hasSoftKeys(Context c) {
    if(Build.VERSION.SDK_INT &lt;= 10 || (Build.VERSION.SDK_INT &gt;= 14 &amp;&amp;
            ViewConfiguration.get(c).hasPermanentMenuKey())) {
        //menu key is present
        return false;
    } else {
        //No menu key
        return true;
    }
}
</code></pre>

<p>The problem there is, that the Soft-Key-Buttons have a different height on different devices, so I would have to check the height of the Soft-Key-Buttons too (which is possible and already answered on StackOverflow).</p>

<p>I'm stuck at this problem for a few weeks now and would really appreciate any help.</p>