简体   繁体   English

Android上带有Angular 2的Nativescript,如何关闭我的应用程序?

[英]Nativescript with Angular 2 on Android, how to close my app?

I would like a button. 我想要一个按钮。 When you tap the button, the application closes, and go to home screen. 当您点击按钮时,应用程序将关闭,并进入主屏幕。 Not needed to really close the app, just go to home screen. 无需真正关闭应用程序,只需进入主屏幕即可。

How can I achieve this? 我该如何实现?

On iOS you're not allowed by the operating system to programmatically close the app. 在iOS上,操作系统不允许您以编程方式关闭该应用。

I'm not sure it's a good practice on Android, but it has been asked and answered many times on StackOverflow. 我不确定这在Android上是否是个好习惯,但是在StackOverflow上已经多次询问和回答了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Angular 中使用 Nativescript 关闭模态窗口? - How to close a modal window with Nativescript in Angular? 我如何在iOS / Android中嵌入NativeScript Angular应用程序并导航到现有应用程序中的某些路由 - How can i embed an NativeScript Angular app in iOS / Android and navigate to certain routes from the existing app 如何在android和nativescript angular中禁用ios中的截图 - How to disable screenshot in android and ios in nativescript angular 如何在Android中以编程方式通过我的应用程序关闭所有最近的应用程序 - How to close all Recent App through my app programmatically in android 如何使地理定位后台服务在我的nativescript-angular应用程序中工作? - How to make geolocation background services work in my nativescript-angular app? 如何为NativeScript Android更新App-Icon - How to update the App-Icon for NativeScript Android 如何在nativescript中启动android插件应用 - How to launch android plugin app within nativescript 如何在 nativescript 应用程序中捕获 android dispatchKeyEvent? - How catch android dispatchKeyEvent in nativescript app? 带有Angular 2的Nativescript中的Android小部件 - Widget for Android in Nativescript with Angular 2 在 nativescript 版本更改后,我如何正确构建我的 android 应用程序 - How do i properly build my android app after nativescript version change
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM