I have a B4A (and B4I) application with a main activity with 5 buttons, when select a button open a activity for each button.
Each activity have a AdMob banner.
All work fine.
The problem is that the banner is loaded again for each activity, it's showed many times, but for a bit of time.
The result is many impression, but a bit of money.
i have done in this mode, now the second activity don't receive a new banner, but into secondo activity the banner is not received again (no Ad_ReceiveAd event).
Main activity
B4X:
Sub Globals
Dim AdView1 As AdView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
AdView1.Initialize("Ad", "xxxxxxxxxxxxxxxxxxxxx/yyyyyyyyyy")
Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip)
AdView1.LoadAd 'loads an ad
AdView1.Background = Null
End Sub
Sub ButtonShow_Click
AdView1.RemoveView
StartActivity(Show)
CallSubDelayed2(Show,"SetAdView",AdView1)
End Sub
Show Activity
B4X:
Sub Globals
Dim AdView1 As AdView
End Sub
Sub SetAdView (Banner As AdView)
AdView1 = Banner
Activity.AddView(AdView1, 0dip, 0dip, 320dip, 50dip)
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Show")
End Sub