How To preload AdMob interstitial ad and send to another android activity using intent

后端 未结 5 1289
醉话见心
醉话见心 2020-12-10 08:12

I need some help regarding AdMob interstitial ad.

I want to preload the interstitial ad in one activity. this is straight forward.

// Create an ad.
          


        
5条回答
  •  一生所求
    2020-12-10 08:29

    InterstitialAd can be instantiated using any Context so you could instantiate it (and request ad) during onCreate of Application subclass and then later show the ad from anywhere in your code.

    This way, you maximise the chances of an ad being loaded by the time you want to show it.

    It would be good practice to use an AdManager (like mentioned in another answer), but not necessary to do so.

提交回复
热议问题