Android Question FirebaseAdmob doesn't show banner ads

DickD

Active Member
Licensed User
I'm just getting started with Firebase Admob. I have it working with the sample module provided. Now I'm trying to integrate it with my existing modules. I've added the code below to the Main module. The banner doesn't show on the screen. However when I click on the screen in the area where I know the banner should be it DOES launch. I have tried with and without .Visible, .bringtofront and .enabled. Also tried putting it above the loadlayout call. Why can I click it but not see it? Do I need to add a label or button in the Main designer layout to hold a place for this?

B4X:
Sub Activity_Create(FirstTime As Boolean)
....
BannerAd.Initialize2("BannerAd", "ca-app-pub-3940256099942544/6300978111", BannerAd.SIZE_SMART_BANNER)
 Dim height As Int
 If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
 'phones
 If 100%x > 100%y Then height = 32dip Else height = 50dip
 Else
 'tablets
 height = 90dip
 End If
 Activity.LoadLayout("Main")
 Activity.AddView(BannerAd, 0dip, 100%y - height, 100%x, height)
 BannerAd.LoadAd
 BannerAd.Visible = True
 BannerAd.BringToFront
 BannerAd.Enabled = True
 
Top