Blackberry WebWorks and the "Hardware Back Button"

I have a problem with the hardware back button and Blackberry Webworks.

I am using jquery mobile to create a phonegap application for Blackberry WebWorks (version for smartphones). When I have a link on my page, for example:

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

everything is working fine.

But when I use the WebWorks API to connect a "Hardware Back Button" like this

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

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

It is also strange when I change a function:

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

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

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

Can someone help me further?

thanks

+4
source share
1 answer

Adding this file to config.xml for me:

 <feature id="blackberry.system.event" version="1.0.0"/> 
+4
source

All Articles