Android Question AdaptiveSize.Get("height") problem

danijel

Active Member
Licensed User
Longtime User
Hi,

I'm trying to load the height of the Admob banner so I can position the other app elements.
I use the standard steps:

I noticed that the problem only occurs when I add the instructions for reward ads from here:

My application is always in landscape mode (#SupportedOrientations: landscape)
So the problem occurs at the first launch of the application.
I get an unrealistically large number for AdaptiveSize.Get("height"). Specifically, it is 247px on my device. (Image1)
I assume that this data is loaded before the orientation is changed. Subsequently, the test advertisement is not even shown.

If I restart the app, then everything is fine (Height=156px) and test ads load normally (Image2).
No matter how many times I kill and reload the app later everything is fine. The problem is only on the first fresh start (if I reinstall).

Also important to emphasize. If my system is in landscape mode and I start the application for the first time, everything is also fine.
The problem is if the system is in portrait mode (which is almost always the case) and the first launch of the application.

Do you have any idea how to get around this problem?
 

Attachments

  • Image1.jpg
    Image1.jpg
    21.7 KB · Views: 115
  • Image2.jpg
    Image2.jpg
    21.2 KB · Views: 122
  • AdSize Test.zip
    10.8 KB · Views: 160
Top