Hi, I’m trying to integrate cocos with android but I’m having a problem when I need to open cocos activity by clicking in a android notification on notification bar.
For my cocos activty I have this:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Cocos2dxHelper.init(this, this);
setContentView(R.layout.main);
this.mGLView = (Cocos2dxGLSurfaceView) findViewById(R.id.game_gl_surfaceview);
this.mGLView.setEGLContextClientVersion(2);
this.mGLView.setCocos2dxRenderer(new Cocos2dxRenderer());
}
static {
System.loadLibrary(“game”);
}
When I start my application this code runs ok. After initialization I put my application on backgroung and run a code to receive a notification linked to this activity. When I click on the notification a black screen appears and logCat get a lot of exceptions like this:
07-26 11:33:36.826: W/Adreno200-ES20(12221): <*load_uniform_matrix:801>: GL_INVALID_OPERATION
07-26 11:33:36.826: D/cocos2d-x debug info: OpenGL error 0x0502 in C:/dev/cocos2d-x/game/proj.android/…/…/cocos2dx/sprite_nodes/CCSprite.cpp draw 591
07-26 11:33:36.826: D/cocos2d-x debug info: OpenGL error 0x0502 in C:/dev/cocos2d-x/game/proj.android/…/…/cocos2dx/sprite_nodes/CCSprite.cpp draw 591
07-26 11:33:38.448: W/Adreno200-ES20: <*load_uniform_matrix:801>: GL_INVALID_OPERATION
07-26 11:33:38.448: D/cocos2d-x debug info(12221): OpenGL error 0x0502 in C:/dev/cocos2d-x/game/proj.android/…/…/cocos2dx/sprite_nodes/CCSprite.cpp draw 591
Anyone knows how to deal with this problem?
The onCreate method runs, because when I put any log on that it appears on logCat. It seems like I need to initialize something from cocos, could anyone help me if this problem?
Thanks,
Thiago