Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you have two banner ads on one page?

Tags:

android

admob

I am trying to have two banner ads on the same page through admob in android studio. I have one ad working, but I am not sure how to get the other working.

So far this is what I have for one ad in java:

     AdView adView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder()
            .setRequestAgent("android_studio:ad_template").build();
    adView.loadAd(adRequest);

This works, but how would I add a second ad with the ID adView2?

like image 443
diamondcgaming applications Avatar asked Dec 14 '25 17:12

diamondcgaming applications


1 Answers

Showing two ads on the same screen at the same time is actually a violation of AdMob's policies, and could result in the suspension of your account. I would not recommend implementing an app that way.

like image 104
RedBrogdon Avatar answered Dec 16 '25 08:12

RedBrogdon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!