开发者

Android: reading started time of Running Application. Is it only possible for Services?

I am able to read the started time of a running Service using this :

ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningServiceInfo> services = am.getRunningServices(Integer.MAX_VALUE);
for (RunningServiceInfo info : services) {
    activeTime=info.activeSince;
}

But i could not find option to read started time of running Application

Her开发者_如何学Ce is my Code

ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningTaskInfo> tasks= am.getRunningTasks(Integer.MAX_VALUE);
for (RunningTaskInfo info : tasks) {
    //HOW TO GET started time ??
}

My question is : How to read started time of a Running App? Is this option really not available for running Application ?

I have seen some app(installed in my phone) are displaying started time of a Application.

I googled about it, see some QA on SO. But could not found the solution.


Another questions like yours Running process start time

No way to read start time of app from APIs. Only possible for services through API.

I think the time you are seeing is the activeSince. The app probably has a service and therefore you are seeing the activeSince.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜