我試圖在自定義視圖上顯示廣告,但不知何故我看不到它。爲什麼我看不到廣告?
layout = new LinearLayout(this);
layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
layout.setOrientation(LinearLayout.HORIZONTAL);
view = new GameView(this);
adView = new AdView(this);
adView.setAdUnitId("id");
adView.setAdSize(AdSize.BANNER);
layout.addView(view);
layout.addView(adView, 640, 100);
adView.loadAd(new AdRequest.Builder().addTestDevice("id").build());
setContentView(layout);
我假設你已經用正確的ID替換了'setAdUnitId()',對吧? – nKn
是的,我只是重播它的帖子。 – Busti