Android Admob Ad不';不显示
在我的android应用程序中,测试广告显示成功,但真实广告不显示。 我在logcat中收到此错误:-Android Admob Ad不';不显示,android,admob,Android,Admob,在我的android应用程序中,测试广告显示成功,但真实广告不显示。 我在logcat中收到此错误:- 11-02 13:14:21.129: W/Ads(6341): There was a problem getting an ad response. ErrorCode: 0 11-02 13:14:21.133: W/Ads(6341): Failed to load ad: 0 有谁能告诉我为什么会这样吗 显示广告的我的代码: 我打电话来的主要活动 AdUtils.sh
11-02 13:14:21.129: W/Ads(6341): There was a problem getting an ad response. ErrorCode: 0
11-02 13:14:21.133: W/Ads(6341): Failed to load ad: 0
有谁能告诉我为什么会这样吗
显示广告的我的代码:
我打电话来的主要活动
AdUtils.showAd(context);
那么我的showAd是这样的:
public static void showAd(Context context) {
try {
isGooglePlayServiceAvailable = Utils.isGooglePlayServiceAvailable(context);
if (isGooglePlayServiceAvailable) {
showInterstitalAd(context);
}
else {
}
} catch (ClassCastException e) {
e.printStackTrace();
return;
}
}
public static void showInterstitalAd(Context context) {
try {
final InterstitialAd interstitial = new InterstitialAd(context);
interstitial.setAdUnitId(Constants.INTERSTITIAL_AD_ID);
AdRequest adRequest = new AdRequest.Builder()
.build();
interstitial.loadAd(adRequest);
interstitial.setAdListener(new AdListener() {
public void onAdLoaded() {
super.onAdLoaded();
if (interstitial.isLoaded()) {
interstitial.show();
}
};
});
} catch (Exception e) {
Log.i("TEST", "Ad Mob execpt");
e.printStackTrace();
}
}
您刚才创建了id吗?请发布你的代码:你是如何制作广告的?你在用模拟器测试真实广告吗?我在模拟器和真实设备上都做过测试。