Android双击后退键退出APP
来源:
ray34ray34
2016-11-15
请问我用什么方法可以在Android中双击后退键退出APP,我以前用document.addEventListener('backbutton', backmenuEvent, false)和navigator.app.exitApp() 这两个方法来达到效果,但我在ionic2中使用,就点击一下就直接退出程序了。
写回答
2回答
-
Parry
2016-11-16
http://blog.parryqiu.com/2016/09/25/ionic2_android_handling-the-hardware-back-buttons/
012016-11-17 -
ray34ray34
提问者
2016-11-17
我想问一下!
1. platform.exitApp();这个方法是ionic的还是cordova的方法?
2.还有import {Platform, ionicBootstrap} from 'ionic-angular'; cmd中提示说ionicBootstrap 没有找到!我用的版本是ionic 2.1.4,是不是和我的版本有关系?
3.我把ionicBootstrap去掉了,但是退出的效果没有出来
00
相似问题