Languages

Menu
Sites
Language
Hardware back button not working

I am trying to submit my app to the TIzen Store but it keeps failing due to the back button not working right.

When I press the back button I get  the followig alert box which is not what I expect to happen. I expect the app to exit.

The code is listed below...

    document.addEventListener('tizenhwkey', function(e) {
    alert(e.keyName);
        if(e.keyName == "back"){
           tizen.application.getCurrentApplication().exit();
        }
        if(e.KeyName == "menu"){
        alert("MENU");
        }
 
    });
 
Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

5 Replies
Raghavendra Reddy Shiva
The same code works fine for me. Assuming you are working on device, if so do you have the correct 2.2 images flashed ? Please try the below 2.2 image. http://download.tizen.org/releases/2.2/tizen-2.2/images/RD-PQ-REF/
Josh Dobbs
I'm actually still having issues with my test device so I can't test on it right now.
Marco Buettner
You test on the simulator so it works fine! On the simulator you have not an appdrawer and so the app will restart on pressing hardware backbutton. Test it on emulator and you will see it works fine!
Josh Dobbs
Thanks Marco. Yes i was testing on the simulator.
Sergey
try this: $(window).on("tizenhwkey", function(e) { ...... })