Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use ionic+html5+API to double-click the return key to exit the application

Shulou Source: shulou.com Published: 2022-05-31 13:13:42 09月24日 Update

This article mainly introduces "ionic+html5+API how to double-click the return key to exit the application", in the daily operation, I believe that many people in the ionic+html5+API how to achieve double-click return key to exit the application of the problem there are doubts, editor to consult all kinds of data, sort out a simple and easy to use method of operation, hope to answer the "ionic+html5+API how to achieve double-click return key to exit the application" of the doubt to help! Next, please follow the editor to study!

Using ionic+MUI to jointly develop app, in view of the fact that the double-click return key realized unilaterally by ionic is too complex, I came up with the function of using ionic and html5+API to use double-click return key to exit the application and click the return key to return to the upper layer.

$scope.listenbackbutton = function () {document.addEventListener ("plusready", onPlusReady, false); function onPlusReady () {plus.key.addEventListener ("backbutton", function () {if ($location.path () = ='/ tab/index') {if (plus.os.name = = "Android") {$ionicLoading.show ({template: "Click the return key again to exit the application"}) $timeout (function () {$ionicLoading.hide (); plus.key.removeEventListener ("backbutton", function () {}); return;}, 1000); plus.key.addEventListener ("backbutton", function () {plus.runtime.quit ();}) } else {outSet ("this platform does not support direct exit of the program, please press the Home key to switch applications");}} else {$ionicHistory.goBack ();}});}} at this point, the study on "how to double-click the return key to exit the application" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Application learning more help complex practical next upper layer again function unilateral unilateral platform article method theory knowledge program article website Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn Shulou Tech Info Huawei MySQL