AdMob won't show the banner until refresh or sign in to google plus

后端 未结 5 1894
别那么骄傲
别那么骄傲 2020-12-28 18:50

I\'ve got a problem. My AdMob has been set up for some time now without any problem, but I noticed something wrong. Ad gets successfully loaded (i see message from ddms), bu

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-28 19:47

    As nobody has replied with explanation, I'm going to consider this one solved. I just manually reload whole layout onAdLoad event. Anyway, this is just functional solution, it does not explain why it happens with Google Play Services AdMob.

    adMobView.setAdListener(new AdListener() {
    
        @Override
        public void onAdLoaded() {
            super.onAdLoaded();
    
            MainActivity.this.runOnUiThread(new Runnable() {
    
                @Override
                public void run() {
                    layout.requestLayout();
                }
            });
        }
    
    });
    

    Also, as mentioned by user3263204, you can try this

    adMobView.setBackgroundColor(Color.BLACK);
    

    to solve your problem.

提交回复
热议问题