![](/img/trans.png)
[英]Is there any way to programmatically determine when an app was last opened?
[英]a way to programmatically know when an application is in “opened” state on android?
我想知道是否存在以编程方式从后台服务获取“打开的”应用程序名称或其他名称的方法。 是吗? 就像我给你一个例子:
if(Apps.FACEBOOK_STATUS_OPENED == currentApplication.getStatus()) {
...
do something in the service for this app
}else if(Apps.WHATSAPP_STATUS_OPENED == currentApplication.getStatus()) {
...
do another thing for this app
}...
有办法听吗? 必须有。
提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.