Android-如何获取每个应用的使用情况/屏幕时间? [英] Android - How to get usage/screen time for each app?

查看:426
本文介绍了Android-如何获取每个应用的使用情况/屏幕时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了一个应用程序,该应用程序记录了您的手机和每个应用程序的屏幕显示时间,但令我惊讶的是,即使我刚安装了第一个应用程序,该应用程序仍具有当日和上周的详细屏幕显示时间时间.我目前的猜测是屏幕时间实际上是由Android系统记录的,所以我的问题是如何访问此数据?

I downloaded an app that records screen time for your phone and each of your apps, but to my surprise, the app had detailed screen time for the current day and the previous week, even though I just installed the app for the first time. My current guess is that screen time is actually recorded by Android System, so my question is how do I access this data?

推荐答案

您可以从 UsageStatsManager .它返回的 UsageStats 具有类似 getTotalTimeInForeground() 可以提供该数据.

You can get this information from UsageStatsManager. The UsageStats it returns has methods like getTotalTimeInForeground() that can supply that data.

这篇关于Android-如何获取每个应用的使用情况/屏幕时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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