I have a custom Dialog as shown below:



When I click on the Edit Text, The dialog is shifted upwards but half of the dialog becomes invisible as shown below:


I verified the issue on Android ICS and Gingerbread but it doesn't happen on Android Lollipop.

I appreciate your help for figuring out why.

Here is the custom dialog layout XML:

&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutChatInGame"
android:layout_width="305dp"
android:layout_height="190dp"
android:background="@drawable/dialog_table_border"
android:orientation="vertical"
android:visibility="visible"&gt;

&lt;LinearLayout
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/roomlist_title_background"&gt;

    &lt;ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/progressBar"
        android:layout_margin="5dp"/&gt;

    &lt;LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:layout_margin="5dp"&gt;

        &lt;LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"&gt;

            &lt;TextView
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:text="Game is on hold because the host paused the app"
                android:id="@+id/lblOnHoldDialogMessage"
                android:textColor="@color/progress_dialog_on_hold_text"
                android:textSize="18dp"
                android:singleLine="false"
                android:layout_gravity="center_horizontal"/&gt;
        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;

&lt;/LinearLayout&gt;

&lt;TextView
    android:id="@+id/lblChatHistoryGameOnHold"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:gravity="bottom"
    android:maxLines="5"
    android:scrollbars="vertical"
    android:textColor="@color/edit_text_general_text"
    android:textColorHint="@color/edit_text_general_hint"
    android:paddingRight="2dp"
    android:paddingLeft="2dp"/&gt;

&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"&gt;

    &lt;EditText
        android:id="@+id/textChatGameOnHold"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="2dp"
        android:layout_marginStart="2dp"
        android:layout_weight="1"
        android:ems="10"
        android:hint="@string/edit_text_send_chat_message"
        android:imeOptions="flagNoExtractUi|actionDone"
        android:inputType="text"
        android:maxLength="100"
        android:maxLines="1"
        android:textColor="@color/edit_text_general_text"
        android:textColorHint="@color/edit_text_general_hint"/&gt;

    &lt;Button
        android:id="@+id/btnSendGameOnHold"
        style="@style/lightboxButton.Blue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="sendChatMessageInGame"
        android:text="@string/btn_send"/&gt;
&lt;/LinearLayout&gt;

&lt;/LinearLayout&gt; 



Question: Complete induction
Answer: There is one more (easier) way to solve this problem without induction: Expand the summand into partial fractions to obtain (denote $S_n$ the actual sum):
$$
S_n = \frac{1}{2} \sum_{k=1}^{n}\bigg(\frac{1}{2k-1}-\frac{1}{2k+1} \bigg)=\frac{1}{2} \bigg(1-\frac{1}{3} +\frac{1}{3} + \cdots - \frac{1}{2n+1} \bigg) = \frac{n}{2n+1}
$$