本文介绍了Admob广告监听器(android)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望加载admob广告时在我的应用中发生一个事件。我到处都在搜寻,但我不知道该怎么做!有人知道示例或教程在哪里吗?我知道它涉及到 public void onReceiveAd(Ad ad);
...
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);
...
推荐答案
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.
}
});
这篇关于Admob广告监听器(android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!