Notice
Pay attention, app.local.exit
should be define at the defint object section and also app.functions.toast
must be define inside functions section.
The control API is for manipulation some native control like android back. It has no entry argument.
app.control.onBack
is called when the back button is pressed on android devices. So on this event we can manipulate the back in user device.
Type:
Function
app.control.onBack = function () {};
// on back button event just in android
app.control.onBack = function () {
var next = function () {
if (app.local.exit)
Android.exit();
else {
setTimeout(function () {
app.local.exit = false;
}, 10000);
app.functions.toast('Press back button again to exit.', {duration: 1000});
app.local.exit = true;
}
};
next();
};
Pay attention, app.local.exit
should be define at the defint object section and also app.functions.toast
must be define inside functions section.