我是 Android 游戏开发的新手。我正在努力在我的游戏中展示 Admob。我究竟做错了什么?
LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams(
getWindowManager().getDefaultDisplay().getWidth(),
getWindowManager().getDefaultDisplay().getHeight()
+ getWindowManager().getDefaultDisplay().getHeight()
- 50);
adView = new AdView(CandygrabberActivity.this, AdSize.BANNER,
MY_AD_UNIT_ID);
adRequest = new AdRequest();
adRequest.setTesting(true);
adView.loadAd(adRequest);
CCDirector.sharedDirector().getActivity()
.addContentView(adView, adParams);