Admob ad listener (android)

三世轮回 提交于 2020-03-05 00:37:39

问题


I want an event to happen in my app when an admob ad is loaded. I've been searching everywhere but I cant figure out exactly how to do this! Does anyone know where an example or tutorial is? I know it involves something with public void onReceiveAd(Ad ad);...


回答1:


check this documentation, it might help.




回答2:


mAdView.setAdListener(new AdListener() {
    @Override
    public void onAdLoaded() {
        // Code to be executed when an ad finishes loading.
    }

    @Override
    public void onAdFailedToLoad(int errorCode) {
        // Code to be executed when an ad request fails.
    }

    @Override
    public void onAdOpened() {
        // Code to be executed when an ad opens an overlay that
        // covers the screen.
    }

    @Override
    public void onAdLeftApplication() {
        // Code to be executed when the user has left the app.
    }

    @Override
    public void onAdClosed() {
        // Code to be executed when when the user is about to return
        // to the app after tapping on an ad.
    }
});


来源:https://stackoverflow.com/questions/9556248/admob-ad-listener-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!