2013-10-24 59 views
2

我是Android遊戲開發新手。我正在努力在我的遊戲中展示Admob。我究竟做錯了什麼?如何將admob放置在Cocos2d android中?

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); 

回答

相關問題