Admob. The interstitial orientation is fixed to the initial orientation of the device at startup

I have a problem integrating Admob interstitial ads. My application supports orientation in both portrait and landscape, and so I set the manifest:

android:screenOrientation="fullSensor" 

The problem is that the Admob interstitial appears to be locked / locked by the device’s original orientation at startup. For example. if I launch the application in portrait orientation, and then rotate the device in landscape mode and then display an ad, then it appears on the side (in portrait orientation) ...

How can I force the interstitial reset object to a new device orientation?

I load the ad as follows:

 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 as follows:

 interstitialAd.show(); 
+7
android admob
source share
3 answers

I fixed it. In the end, this led to a repeated request for an orientation change announcement and, importantly, the execution of this request in the user interface thread.

+4
source share

Are you looking for SMART_BANNER ??

Use it as:

 <com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" ads:adSize="SMART_BANNER" ads:adUnitId="XXXXX"> </com.google.android.gms.ads.AdView> 
+1
source share

I don’t know if this link will be useful or not ... If my answer is inappropriate dnt downvote ... Her android link resize on the landscape

0
source share

All Articles