public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); timer += gameTime.ElapsedGameTime.Milliseconds; if (timer > 60000) { #if ANDROID //-------------------------------------------------InterstitialAd stuff Android.Gms.Ads.InterstitialAd FinalAd = AdWrapper.ConstructFullPageAdd(Manager.activity, Manager.AdsID); var intlistener = new adlistener(Manager); intlistener.AdLoaded += () => { if (FinalAd.IsLoaded) { FinalAd.Show(); } }; FinalAd.AdListener = intlistener; FinalAd.CustomBuild(); SetTimer(); //------------------------------------------------------------- #endif timer = 0; } }
private void MenuMenu1EntrySelected(object sender, PlayerIndexEventArgs e) { try { #if ANDROID //-------------------------------------------------InterstitialAd stuff Android.Gms.Ads.InterstitialAd FinalAd = AdWrapper.ConstructFullPageAdd(Manager.activity, Manager.AdsID); var intlistener = new adlistener(Manager); intlistener.AdLoaded += () => { if (FinalAd.IsLoaded) { FinalAd.Show(); } }; FinalAd.AdListener = intlistener; FinalAd.CustomBuild(); SetTimer(); //------------------------------------------------------------- #endif } catch (Exception ex) { Console.WriteLine(ex.Message + ex.StackTrace); } }