Native backButton eventlistener? possible?

You must Login before you can answer or comment on any questions.

I'd like to have an eventListener on backbutton of the iPhone.

I know i can make a custom backbutton, but this is not native! Its the native backbutton i want, there should be a way of knowing when this button is pressed.

As for the reason: When i press a button a window opens with a mapView.

Now when i press back the gps is still on, and i read that the mapview still exist. So i want to remove the mapview and close the window and any other method to shut down the gps.

— asked 2 years ago by Kami -
0 Comments

3 Answers

Accepted Answer

The back button does the same as window.close(), so you can try to catch the close event of the current window.

— answered 2 years ago by Dan Tamas
answer permalink
4 Comments
  • Nice, dint think about that.

    Ty for quick response. Now to figure out how to shut down the gps.

    — commented 2 years ago by Kami -

  • catch the window \'blur\' event.

    — commented 2 years ago by Kosso .

  • ty this also works,

    but still searching how to shut down the gps of the mapview

    — commented 2 years ago by Kami -

  • Show 1 more comment

customBackButton.addEventListener('click', function() {
    navGroup.close(currentWindow);
});

For IPhone only (Android:back event works for Android catching back button): On a tabgroup, listening to the close event of the windows in each tab does not seem to catch the back button being pressed. I am using SKD 2.0.1 GA2. Anyone has a solution?

Your Answer

Think you can help? Login to answer this question!