机器人 - 出境申请code [英] android - exit application code

查看:126
本文介绍了机器人 - 出境申请code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,主页上我通过应用程序有导航按钮。

I have an application where on the home page I have buttons for navigation through the application.

在该网页我有一个按钮,EXIT,当按下应采取用户到主屏幕的手机,其中的应用程序图标上。

On that page I have a button "EXIT" which when clicked should take the user to the home screen on the phone where the application icon is.

我怎么能这样做?

推荐答案

Android的设计不利于退出通过选择一个应用程序,而是由操作系统管理它。您可以通过其相应的意图打开主页的应用程序:

Android's design does not favor exiting an application by choice, but rather manages it by the OS. You can bring up the Home application by its corresponding Intent:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

这篇关于机器人 - 出境申请code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆