How to call method from AndroidGameActivity (i.e. for displaying admob-ads)

Hi there,

we have a few methods on our Activity1 to show admob-banners or interstitial. I´m fairly new to xamarin and the mixed Android/Java-style/XML/C#-Stuff but I just can´t figure out how to call any of those methods from our Game1-Activity. I tried to save the instance of Activity1 in a member of Game1 and tried to call it from there but I just don´t know how to do.
There must be a real easy solution for that as nobody else seemed to have that problem but maybe somebody out there can help me out here.

Thank you,

Harry

You need to cast the Activity property to your derived Activity type.

Activity1 myActivity = (Activity1)Game.Activity;

Thank you KonajuGames

I actually thought that I did that already but I guess I didn´t :slight_smile:
That´s kinda embarassing as it´s standard c#-stuff and doesn´t have anything to do with Xamarin. :anguished:

Thanks again,

Harry

Here ya Go Full page regular and Reward ads from inside monogame