|
@@ -119,7 +119,7 @@ export class ToolsHelper {
|
|
|
* 双击退出
|
|
|
* @param msg
|
|
|
*/
|
|
|
- static doubleAndExit() {
|
|
|
+ static doubleAndExit(event?:()=>void) {
|
|
|
const cTime = new Date().getTime()
|
|
|
console.log('=====>', cTime)
|
|
|
console.log('=====>', cTime - ToolsHelper.oTime)
|
|
@@ -127,8 +127,12 @@ export class ToolsHelper {
|
|
|
ToolsHelper.oTime = cTime
|
|
|
ToolsHelper.showMessage('双击退出')
|
|
|
} else {
|
|
|
- // getContext().getApplicationContext().killAllProcesses();
|
|
|
- (getContext() as common.UIAbilityContext).terminateSelf()
|
|
|
+ if (event) {
|
|
|
+ event()
|
|
|
+ }else{
|
|
|
+ (getContext() as common.UIAbilityContext).terminateSelf()
|
|
|
+ // getContext().getApplicationContext().killAllProcesses();
|
|
|
+ }
|
|
|
}
|
|
|
return true
|
|
|
}
|