1

In my MainActivity there are some EditTexts. The first one is focusable and I made the keyboard to appear automatically with this command in onCreate:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);

It is the only way that worked for me to pop the keyboard up automatically when the app starts. Trying to simulate EditText click didn't work but it would be great if it would.

So here is the problem: When the keyboard pops up, my AdView gets over it and covers some content. I want it always to be pinned at the bottom of the screen, I even made a LinearLayout where I put the adView but it still pops up over the keyboard. I can prevent it by using the following in the onCreate instead of SOFT_INPUT_STATE_VISIBLE: getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

But in this way the keyboard doesn't pop up automatically.

So is there a way to pin the adView so that it would NOT pop up above the keyboard AND make the keyboard appear automatically when the app starts?

By the way, here's my AdView:

<Relative Layout>
<elements>
</elements>

<LinearLayout android:layout_width="fill_parent"
        android:id="@+id/ad_layout"
        android:layout_height="wrap_content"
        android:gravity="bottom"
        android:layout_alignParentBottom="true"
        >
    <com.google.android.gms.ads.AdView android:id="@+id/adView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"
        ads:adUnitId="my-identifier"
        ads:adSize="BANNER"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
         />
    </LinearLayout>
</RelativeLayout>

0 Answers0