title: How to identify when the Android device was used last time
body: <p>I am writing a piece of code in Android that will try to identify when was the last time the Android device was used by the user. By used I mean any operation performed. If the device is not used at all for lets say 1 full day I want to perform some action for it in my service which is running. So basically when the device is not getting used (idle state) that time I want to identify all this.</p>
  
  <p>Is it possible in Android to achieve this? How can I proceed further for this requirement.? </p>
  
  <p>Any pointers will be helpful to identify the device was not used for X days(or hours) and perform some action on it from idle state.</p>
  
  <p>Thanks!</p>