[英]Can you show both banner ads and interstitial ads?
您可以在同一活動中同時展示橫幅廣告和插頁式廣告嗎? 它違反了AdMob政策嗎?
例如,當您打開應用時,會顯示插頁式廣告,當您關閉橫幅廣告時,橫幅廣告會顯示,或者當展示橫幅廣告時,您會顯示插頁式廣告。
是的你可以。
有關詳細信息, 請查看文檔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();
}
});
您可以使用自己的代碼填充每個方法:)
當然,您可以在應用程序中顯示橫幅廣告和插頁式廣告。 干得好。
MainActivity.java在onCreate方法中添加以下代碼行
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.