I'm using PhoneGap and have bound a callback to BlackBerry's hardware back button. The callback gets invoked, and prevents default behavior ( which is to go back to the blackberry home screen ). My binding looks like so:
document.addEventListener( 'backbutton', function()
{
window.history.back();
return false;
}, false )
Now, this works exactly *once*. The first time I use it it correctly causes the app to go "back" one page just like clicking the back button in the header.
However, subsequent clicks of the back button don't work. I know the callback is being invoked, because it the app doesn't quit to the homescreen. But it appears that window.history.back() just magically stops working correctly.
I guess what I want to know is if window.history.back() is the right thing to invoke? Is there a better API call to make?
This is on BlacBerry 6.x