var init = function () {
// TODO:: Do your initialization job
console.log("init() called");
+
+ // add eventListener for tizenhwkey
+ document.addEventListener('tizenhwkey', function(e) {
+ if(e.keyName == "back")
+ tizen.application.getCurrentApplication().exit();
+ });
};
$(document).bind('pageinit', init);
var init = function () {
// TODO:: Do your initialization job
console.log("init() called");
+
+ // add eventListener for tizenhwkey
+ document.addEventListener('tizenhwkey', function(e) {
+ if(e.keyName == "back")
+ tizen.application.getCurrentApplication().exit();
+ });
};
// window.onload can work without <body onload="">
window.onload = init;
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/$${WidgetID|"WidgetID"}" version="1.0.0" viewmodes="maximized">
<tizen:application id="$@{APPID=APPLICATIONID()}.$${WidgetID|"WidgetID"}" package="$${APPID}" required_version="2.1"/>
<content src="index.html"/>
- <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<icon src="icon.png"/>
<name>$${WidgetID|"WidgetID"}</name>
</widget>
//Initialize function
var init = function () {
- $('div[data-role="page"]:first .ui-btn-back').bind("click", function(event) {
- var currentApp = tizen.application.getCurrentApplication();
- currentApp.exit();
- });
// TODO:: Do your initialization job
console.log("init() called");
+
+ // add eventListener for tizenhwkey
+ document.addEventListener('tizenhwkey', function(e) {
+ if(e.keyName == "back")
+ tizen.application.getCurrentApplication().exit();
+ });
};
$(document).bind('pageinit', init);