Using Back Key (hardware key) to close web browser
By Ethan Wade
19 Aug 2013 04:57
English
11 Replies
I have a web app that views external website. This is not a problem. However, when the browser is opened I am unable to use the "Back" hardware key in the simulator to close the browser to return to the app. I have tried to assign a listner to the browser app but with no success. I am able to use the below listed code to successfully use the "Back" button throughout my app but it doesn't work for the browser.
[IMPORTANT] Is there any way to assign an Event Listner to the browser app so that when the "Back" key is pressed it will close (exit) the browser?
document.addEventListener( 'tizenhwkey', function(e) {
if (e.keyName === 'back') {
if ($.mobile.activePage.attr('id') === 'indexJump') {
tizen.application.getCurrentApplication().exit();
} else {
history.back();
}
}
});
Thanks,
Ethan-Anthony
Edited on 18 03, 2014
You must log in to use this service. Log in now?
The tag you entered already exists.
Do you want to report this post as spam?
The post has been reported as spam.
cannot be empty.
Are you sure you want to cancel and return to the list?
The code has been copied to the clipboard.
Enter a title.