micke s
micke s

Reputation: 33

load ad from admob in advance

I have been searching for an answer now for nearly one hour but cant find the answer to what in my mind should be a really simple task.

Is there anyway to request an ad from admob in advance, so that it is possible to show it without any delay. In my case it would mean that the ad is downloaded when the user is playing my game, and when the user loses and the "game over"-screen is displayed, the ad is already downloaded and ready to be displayed immediately.

Upvotes: 3

Views: 1489

Answers (1)

Jack
Jack

Reputation: 745

why don't you put this in the onCreate() Method or where your game is played:

AdView adView = new AdView(this, AdSize.BANNER, "ID");
adView .loadAd(new AdRequest());

and this in your "game over"-screen:

layoutAd.addView(adView);

Upvotes: 3

Related Questions