Screen is stretched after a DialogAlert emerges with Ads from Google Play Services

I am trying to migrate my AdMob code to new Google Play Services ads, and I am facing an issue that I am not able to solve. I am debugging this on a Kindle Fire HDX.

My app uses the position of an ImageView on the screen, through the code. It is within the onWindowFocusChanged part of the code.

public void onWindowFocusChanged (boolean hasFocus){
        int height = view.getHeight();
        int width = view.getWidth();

An AdView banner from Google Play Services is placed on top of the screen (with its corresponding code on the XML file). At a certain moment, the app must show a DialogAlert to save info to a file, and at that point, when the keyboard of the Kindle Fire pops up, the whole layout shrinks above of the emerging keyboard. onWindowFocusChanged is triggered, and the variables “height” and “width” get a lower value.

If I set the Banner adView to invisible, when the DialogAlert is shown, the layout does not shrink (the keyboard is shown on top of the layout) and all works fine.

This issue has not happened before with the old AdMob SDK.

All suggestions are welcome. Thanks in advance.


The option android:windowSoftInputMode=“adjustPan” in the activity section of the Manifest did the trick :slight_smile: