我是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);
答案 0 :(得分:2)