Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native back button #64

Open
tofuorz opened this issue Sep 18, 2012 · 2 comments
Open

native back button #64

tofuorz opened this issue Sep 18, 2012 · 2 comments

Comments

@tofuorz
Copy link

tofuorz commented Sep 18, 2012

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
Copy link
Owner

It seems that the back button should not be caught.

2012/9/18 js-go [email protected]

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//issues/64.

@tofuorz
Copy link
Author

tofuorz commented Sep 19, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants