Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Back button in BB OS 5

The JavaScript syntax looks correct 

https://developer.blackberry.com/html5/apis/blackberry.system.event.html#.onHardwareKey

 

What page are you on when you hit the back button?  Can you confirm that the onHardwareKey event handler is actually being fired?

 

 

Maybe try this instead?

blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,
function() {
   window.location.href = 'local:///mypage.htm';
   return false;
});

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.