博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android从桌面打开图标,发现是之前未返回的应用的解决方法
阅读量:2359 次
发布时间:2019-05-10

本文共 1036 字,大约阅读时间需要 3 分钟。

如果你的应用打开了其他应用程序的activity(好比浏览一张图片或是选择附件),那么有一个很重要的intent的标志需要了解:

Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET

如果不想让用户在Launcher或是桌面的快捷方式上重新打开你的应用时,再返回到你将要打开的其他程序的activity,就要使用这个标志。

例如:点击的是Gmail的图标,打开的却是选择图片的界面,因为这是你之前使用Gamil时的最后的操作,这会让人觉得很怪。

这个标志不会影响最近使用的程序列表或是后退按钮的功能,用户依然可以通过最近的程序列表返回到离开你应用时的状态。

原文:

If your application launches the activities of other applications (such as to view a picture or pick an attachment), there is an important intent flag to know:


Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET

Use this when starting an activity that you don't want the user to return to if they relaunch your application from the app launcher or a shortcut on the home screen. For example, it would be confusing to tap on the Gmail icon and find yourself selecting a picture because that is the last thing you had been doing as part of the Gmail task.

This flag doesn't impact how switching between recents or using the back button works, so the user can still return to your app in exactly the same state they left it by going through recents.

转载地址:http://foitb.baihongyu.com/

你可能感兴趣的文章
弹出run a dll as an app对话框&关机蓝屏的解决方法
查看>>
时空不是连续的
查看>>
勾股定理证明评监
查看>>
评测主流网站统计系统
查看>>
Jxta 命令 shell
查看>>
火页的窝--如何配置JXTA Shell(airclh)
查看>>
澳洲数学高手提速网络
查看>>
[图]跳过Windows,Phoenix开发内建在BIOS的小型操作系统
查看>>
奇技淫巧之避免因宏带来的名字冲突
查看>>
调试dll和exe加载失败
查看>>
wprintf输出中文
查看>>
判断目录是否可写
查看>>
运行chrome ui
查看>>
webkit在win32下的编译规则(三)
查看>>
(记录贴)Docker构建Tomcat、Nginx、Haproxy、Mysql集群
查看>>
Spring源码分析之核心容器类图
查看>>
设计模式之模板模式
查看>>
JVM学习之垃圾收集器
查看>>
JVM学习之内存监控与故障处理工具
查看>>
设计模式之策略模式
查看>>