ZhouWeikuan / cocos2d

cocos2d for android, based on cocos2d-android-0.82, and now ported from cocos2d-iphone 0.99.4. The googlecode address is here: http://code.google.com/p/cocos2d-android-1/ . There are several demos to watch.
610 stars 291 forks source link

native back button #64

Open tofuorz opened 11 years ago

tofuorz commented 11 years ago

in game scene,when press the NATIVE back button,the application was turn off.can I holding the back button? the code for the layer: setIsKeyEnabled(true); @Override public boolean ccKeyDown(int keyCode, KeyEvent event) { // TODO Auto-generated method stub if (keyCode == KeyEvent.KEYCODE_BACK) { CCDirector.sharedDirector().popScene(); return true; } return super.ccKeyDown(keyCode, event); } not useful... please help me.

ZhouWeikuan commented 11 years ago

It seems that the back button should not be caught.

2012/9/18 js-go notifications@github.com

in game scene,when press the NATIVE back button,the application was turn off.can I holding the back button? the code for the layer: setIsKeyEnabled(true); @override https://github.com/override public boolean ccKeyDown(int keyCode, KeyEvent event) { // TODO Auto-generated method stub // Log.e("toufu", keyCode + ""); if (keyCode == KeyEvent.KEYCODE_BACK) { CCDirector.sharedDirector().popScene(); return true; } return super.ccKeyDown(keyCode, event); } not useful... please help me.

— Reply to this email directly or view it on GitHubhttps://github.com/ZhouWeikuan/cocos2d/issues/64.

tofuorz commented 11 years ago

why? when I push a scene A to director,then push another one(scene B),so when I push back button,it seem need to popScene to scene A,not close the app.