0

Do we have option to get activity time information (how long the activity is visible like that) from Activity manager

I would like to get the time information for other apps activity, running in the same device.

The below code is return as the list of recently running apps

ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);

List runningProcesses = manager.getRecentTasks(maxNum, flags);

After this i would like to know how much timing each app spends, at what time it start and what time they end. Do we have option to get this informations?

surya
  • 1
  • 2

1 Answers1

0

Try this trick getCurrentTime in onStart() of activity and getCurrentTime in onStop() method of activity and find difference between both this way you can find how much time activity is visible .

Deep Shah
  • 1,334
  • 3
  • 20
  • 41
  • Thanks for your answer Deep Shah. But I would like to get the time information for other apps activity, running in the same device. getRecentTasks(maxNum, flags) Method will return as all the apps info, running in the device. – surya Aug 11 '14 at 10:12