0
我配置admob在我的應用程序,但問題是當我開始一個遊戲。我只是沒有看到一個橫幅,只是當我點擊它,然後添加是開放的,當我回到遊戲,我看到了橫幅。我不知道什麼是錯的。我的應用程序有一個黑色的背景Libgdx - > AdMob我的橫幅是可見的點擊後
這裏是我的代碼:
adView = new AdView(this);
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useAccelerometer = true;
RelativeLayout relativeLayout = new RelativeLayout(this);
View gameView = initializeForView(new SkippyFlowersGame(this), cfg);
relativeLayout.addView(gameView);
adView.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
Log.i(TAG, "Ad Loaded...");
}
});
adView.setAdSize(AdSize.SMART_BANNER);
adView.setAdUnitId("XXXXXXXXXXXXXXXXXXXXXXXXXXX");
AdRequest.Builder builder = new AdRequest.Builder();
RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
relativeLayout.addView(adView, adParams);
adView.loadAd(builder.build());
setContentView(relativeLayout);
如果您在onCreate()或onResume()中聲明您的廣告請求? –
Well Im未聲明 – Rodriquez
Ahh對不起OnCreate – Rodriquez