I'm having a problem integrating Admob interstitial ads. My app supports both portrait AND landscape orientation, and as such I have set the manifest to:
android:screenOrientation="fullSensor"
The problem is that the Admob interstitial appears to be fixed/locked to the original orientation of the device on start up. E.g. if I start the app in portrait orientation, and then rotate the device to landscape, then show an ad, then it appears on its side (in portrait orientation)...
How can I force the interstitial to reset to the new device orientation?
I am loading the ad like this:
interstitialAd = new InterstitialAd(activity);
interstitialAd.setAdUnitId(Config.ADMOB_UNIT_ID);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
.build();
interstitialAd.loadAd(adRequest);
and then showing it like this:
interstitialAd.show();
I fixed this. In the end it came down to re-requesting the ad on orientation change, and importantly, running that request in the UI thread.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With