4

i have problem with the "hardware back button" and Blackberry Webworks.

I'm using jquery mobile to create a phonegap application for Blackberry WebWorks (Smartphone version). When i have a link in my page like:

<a href="#" onclick="history.back()"></a>

everything works fine.

But when i use the WebWorks API to hook the "Hardware Back Button" like this

blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,
function() {
   history.back();
   return false;
});

My app is just closed. (I tested on 9800 OS6 Simulator, and real device 9300 Curve 3G with OS6)

It's also strange when I modify the function to:

blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,
function() {
   alert('Debug');
   return false;
});

then my app will not be closed (which should be correct)

So the problem is the calling "history.back()" inisde the onHardwareKey handler function.

Can anyone help me further?

Thanks

gpampara
  • 11,989
  • 3
  • 27
  • 26
Peacemoon
  • 3,198
  • 4
  • 32
  • 56

1 Answers1

4

Adding this to config.xml worked for me:

<feature id="blackberry.system.event" version="1.0.0"/>
Calvin
  • 462
  • 4
  • 6