Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Re-assigning BBUI the back button action after assigning it to another handler #505

Closed
laxx opened this issue Dec 8, 2012 · 3 comments
Closed

Comments

@laxx
Copy link

laxx commented Dec 8, 2012

After calling the blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, handleBackKey); to handle the back button on some certain cases. If I call theblackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, null), each time the back button is clicked, the app still calls the previous callback function. How do I set it to BBUI default back button option which pops the current screen and pushes the previous screen in

@jcarty
Copy link
Collaborator

jcarty commented Dec 10, 2012

Instead of swapping the onHardwareKey handler, why not set onbackkey in your bb.init and handle everything in the function you pass in?

The standard handler for the back button on bbUI is bb.popScreen.

@laxx
Copy link
Author

laxx commented Dec 10, 2012

The issue is I only want to handle the back key action just twice in 2 particular screens but want the default behaviour back in all other screens. So there's no way I can avoid a reassignment.

@jcarty
Copy link
Collaborator

jcarty commented Dec 10, 2012

If you really have no other choice:

blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, bb.popScreen);

@tneil tneil closed this as completed Jul 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants