Forum Visual Studio

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

[Xamarin Android Admob] Why doesn't my interstitialAd show up?

Ardian99Ardian99 Member
edited February 2018 in Visual Studio

My InterstitialAd doesn't show up and i checked the permissions "ACCESS_NETWORKSTATE" and "INTERNET". In Addition i added the following Code to the AndroidManifest.xml

<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme="@android:style/Theme.Translucent" />

And this is my Code in MainActivitiy.cs:

`
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.Main);

        MobileAds.Initialize(this, "----id----");
        Button btnDwlSpt = FindViewById<Button>(Resource.Id.btnDwlSpt);
        InterstitialAd mInterstitialAd = new InterstitialAd(this);
        mInterstitialAd.AdUnitId = "ca-app-pub-3940256099942544/1033173712";
        mInterstitialAd.LoadAd(new AdRequest.Builder().Build());

        btnDwlSpt.Click += delegate
        {

            if (mInterstitialAd.IsLoaded)
            {
                mInterstitialAd.Show();
            }
        };
    }`

So what did I wrong?

Sign In or Register to comment.