0

Hi I am working on a sdk project. I need to track time in app. Because of this is an sdk project I dont know starting and exiting activities I cant get time from them. With application class user will be must add my class that extends application to their application tag in the manifest.

Is There any way to catching application start and exit ?

  • 1
    You can use onStart and onPause functions of the Activity to track this – Triode Apr 16 '13 at 11:34
  • I dont want to force users for add this methods. I want do these works in my sdk – user2277650 Apr 16 '13 at 11:36
  • The only possible way there is to do this automatically would be to make the user derive from your custom `Activity` class. However just requiring them to call your SDK in `onResume` and `onPause` is a much cleaner solution (basically every analytics SDK does it this way). The `Application` is not suitable for this, because it will exist for longer than the user actually stays in the app. – Thrakbad Apr 16 '13 at 12:28

0 Answers0