I have a game which has several activities before the game starts. For example, a menu activity, a level select activity and the game itself.
On each of these activities I display a small banner ad (adMob) at the bottom of the screen. I’ve noticed that currently the ad is dropped every time I transition between activities. A new ad is then loaded but this takes time.
Is there a way to make it so that once an advert is loaded, it will remain on the screen regardless of any underlying activity transitions?
edit – still looking for a solution on this one
You can destroy the views and create them by code and thus you’ll have just one Activity but with switching views. Example:
(pseudocode)
if menu = true then
make button1
make button2
make imageview1
etc…
end
if button1 is clicked then
destroy views
make button1
make button2
etc
end
Meanwhile the admob is intact.
If you need more ideas to go around this, read about state machines, keeping a states model will still give you the advatages of the activity since you will know in wich state you are and when something fires up, you can capture that.