问题与cocos2d游戏开始

时间:2013-08-22 07:09:32

标签: java android cocos2d-iphone cocos2d-android revmob

我开发了cocos2d游戏应用程序,这里游戏开始时目标从上到下开始下降,这里没有问题,在添加revmob(广告页面)代码后,目标没有落入屏幕,我有检查revmob代码一切都是正确的,但不知道我哪里出错了,请看看我的问题,提前谢谢:)

@Override
protected void onCreate( Bundle savedInstanceState )
{
    super.onCreate( savedInstanceState );

    // hide titlebar of application
    // must be before setting the layout
  this.requestWindowFeature( Window.FEATURE_NO_TITLE );
    // hide statusbar of Android
    // could also be done later
  this.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );
  this.getWindow().setFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
            WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT );

    mGLSurfaceView = new CCGLSurfaceView(this);
    setContentView(mGLSurfaceView);
    revmob = RevMob.start(this, APPLICATION_ID);
    displayRevMob();

    CCDirector.sharedDirector().attachInView(mGLSurfaceView);

 }

public void displayRevMob(){
    revmob.showFullscreen(this);
        }
    }

1 个答案:

答案 0 :(得分:0)

我认为你需要在活动的onstart方法中添加displayRevMob()方法而不是oncreate。