Esempio n. 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.activity_banner_xml);

            adView            = FindViewById <AdView> (Resource.Id.adView);
            adView.AdListener = new ToastAdListener(this);

            adView.LoadAd(GoogleAdsSampleActivity.GetAdRequest(true));
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.activity_banner_code_ad_listener);

            adView = new AdView(this)
            {
                AdUnitId   = Resources.GetString(Resource.String.ad_unit_id),
                AdSize     = AdSize.Banner,
                AdListener = new ToastAdListener(this)
            };

            var layout = FindViewById <RelativeLayout> (Resource.Id.mainLayout);
            var lp     = new RelativeLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);

            layout.AddView(adView, lp);

            adView.LoadAd(GoogleAdsSampleActivity.GetAdRequest(true));
        }
 public void loadInterstitial(View unusedView)
 {
     showButton.Text    = "Loading Interstitial...";
     showButton.Enabled = false;
     interstitial.LoadAd(GoogleAdsSampleActivity.GetAdRequest(true));
 }