【发布时间】:2014-06-19 22:05:32
【问题描述】:
错误是什么?因为 admob 插页式广告不会显示?
public class MainActivity extends Activity implements AdListener {
private InterstitialAd interstitial;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create the interstitial
interstitial = new InterstitialAd(this, "ca-app-pub-6xxxxxxxx/xxxxxx");
// Create ad request
AdRequest adRequest = new AdRequest();
// Begin loading your interstitial
interstitial.loadAd(adRequest);
// Set Ad Listener to use the callbacks below
interstitial.setAdListener(this);
}
public void onReceiveAd(Ad ad) {
// TODO Auto-generated method stub
Log.d("ads", "onReceiveAd");
if (ad == interstitial)
interstitial.show();
}
谢谢,我不知道,因为不会显示
【问题讨论】: