Is there any way to programmatically determine when an app was last opened?

Viewed 2612

I would like to know when an app (i.e., Facebook or WhatsApp) was last opened.

Without root, is there any way to programmatically determine when an app was last opened in Android?

Important Info:

One issue I have regarding previous suggestions is, if I keep some variation of log then I wouldn't be able to determine when an app was last used if it was used before my Android application was installed.

1 Answers
Related