webapp, written by myself on an Android phone, pressing the back button once will exit app, and return to the desktop, instead of like native app, there will be a prompt, such as "press to exit the application again", but there is still no fallback effect
I am using h-buider to add a string of code
mui.init ({
keyEventBind: {
backbutton: true / / turn off back keystroke listening
}
});
/ return key processing on the home page
/ processing logic: if you press the return key twice in a second, you exit the application;
var first = null;
mui.back = function () {
/ / press the button for the first time to prompt "press again to exit the application"
mui.init ({
keyEventBind: {
backbutton: true //back
}
});
/ return key processing on the home page
/ processing logic: if you press the return key twice in a second, you exit the application;
var first = null;
mui.back = function () {
/ / press the button for the first time, prompting "Press to exit the application again"
if (! first) {
first = new Date().getTime();//
mui.toast("");//
history.go(-1)//
setTimeout(function() {//1s
first = null;
}, 1000);
} else {
if (new Date().getTime() - first < 1000) {//1s
plus.runtime.quit();//app
1
};
also introduces mui.min.js, but has no effect. To achieve this effect, how to write-sharp-sharp-sharp problem description
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)