Answers for "the ad size and ad unit id must be set before loadad is called"

0

the ad size and ad unit id must be set before loadad is called

View adContainer = findViewById(R.id.adMobView);

AdView mAdView = new AdView(context);
mAdView.setAdSize(AdSize.BANNER);
mAdView.setAdUnitId(YOUR_BANNER_ID);
((RelativeLayout)adContainer).addView(mAdView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
Posted by: Guest on April-23-2020

Browse Popular Code Answers by Language