Admob ads not showing up

后端 未结 14 1908
轮回少年
轮回少年 2021-01-02 02:31

I am trying to implement Admob in Android and I am seeing requests coming into AdMob. However, I am not seeing the Admob ads being displayed on the Android screen in the emu

14条回答
  •  清酒与你
    2021-01-02 03:18

    Be sure that your Admob layout is displaying in xml view. Put your admob view inside RelativeLayout and try to use android:alignparentBottom:true

        
        
    
            
    
                
    
                
                
            
        
    

    In your java code put these lines in onCreate method

            // Load addvertisment
            AdView adView = (AdView) findViewById(R.id.adView);
            // Request for Ads
            AdRequest adRequest = new AdRequest.Builder().addTestDevice("FF9CD441FA62FD456D7D571B91DD11DD").build();
    
            adView.loadAd(adRequest);
    

    This worked in my code, Hope it will help you too.

提交回复
热议问题