您可以在同一活动中同时展示横幅广告和插页式广告吗?是针对AdMob政策吗?
例如,当您打开应用时,会显示插页式广告,当您关闭它时会显示横幅广告,或者当展示横幅广告时,您会显示插页式广告。
答案 0 :(得分:1)
是的,你可以。
查看文档以获取更多信息 https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals
另外,您可能会发现使用“AdListener”对您的目的非常有用!
adView.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
//Called when the user is about to return to the application after
super.onAdClosed();
}
@Override
public void onAdFailedToLoad(int errorCode) {
//Called when an ad request failed
super.onAdFailedToLoad(errorCode);
}
@Override
public void onAdLeftApplication() {
//Called when an ad leaves the application (e.g., to go to the browser)
super.onAdLeftApplication();
}
@Override
public void onAdOpened() {
//Called when an ad is received
super.onAdOpened();
}
@Override
public void onAdLoaded() {
//Called when an ad opens an overlay that covers the screen
super.onAdLoaded();
}
});
您可以使用自己的代码填写每个方法:)
答案 1 :(得分:0)
当然,您可以在应用中显示横幅广告和插页式广告。你走了。
MainActivity.java在onCreate方法中添加以下代码行