我花了3天时间从Google Admob SDK迁移到Google移动广告SDK,横幅就像往常一样展示,但只有插页式广告没有显示,我是否遗漏了下面的内容:
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.mediation.admob.AdMobExtras;
public class interstitial_Ads extends Activity {
private static final String AD_UNIT_ID = "85735d538e4e4bd0";
private InterstitialAd interstitial;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ads_full);
Bundle bundle = new Bundle();
bundle.putString("color_bg", "AAAAFF");
bundle.putString("color_bg_top", "FFFFFF");
bundle.putString("color_border", "FFFFFF");
bundle.putString("color_link", "000080");
bundle.putString("color_text", "808080");
bundle.putString("color_url", "008000");
AdMobExtras extras = new AdMobExtras(bundle);
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(AD_UNIT_ID);
// Create ad request.
AdRequest adRequest = new AdRequest.Builder()
.tagForChildDirectedTreatment(true)
.addNetworkExtras(extras)
.build();
// Begin loading your interstitial.
interstitial.loadAd(adRequest);
}
// Invoke displayInterstitial() when you are ready to display an interstitial.
public void displayInterstitial()
{
if (interstitial.isLoaded())
{
interstitial.show();
}
}
}
只有插页式广告不会显示,但横幅广告会像往常一样显示。 这里的任何人都可以根据我上面的代码解释我吗?
非常感谢。