How to make admob always shows an ad on android?

前端 未结 1 1241
感动是毒
感动是毒 2021-02-11 08:30

I know that there is only a certain fill rate that admob can fill. However I want to show something anyway, or it will make my UI inconsistent. I tried to enable the \"house ad\

1条回答
  •  深忆病人
    2021-02-11 09:18

    Admob will always show an ad if possible. And if it can't show a paid ad, it will show one of your house ads. However sometimes it still doesn't pop up so, like you said, you want to check if it appeared and if not, replace it with something else. Create a listener class that extends SimpleAdListener. Then override the onFailedToReceiveAd method like so:

    @Override
                public void onFailedToReceiveAd(AdView adView)
                {
                    // TODO Auto-generated method stub
                    super.onFailedToReceiveAd(adView);
                    //Display your other view here.
                }
    

    Check the LunarLander sample to get a better idea.

    0 讨论(0)
提交回复
热议问题