title: Android Chronometer, retain time state (and keep counting in background)
body: <p>I have a timer that counts up from the time a user encounters that activity</p>
  
  <p>I am currently using a Chronometer set during onCreate (initially started only when certain conditions are met). But I need the chronometer to keep counting upward until the app and all its views are closed (I have an "Exit" function to do that).</p>
  
  <p>The problem is that the Chronometer gets reset to zero on every time I look at another tab and come back to its activity. (This has to do with the oncreate, but I dont know the way around it)</p>
  
  <p>I didn't find an intuitive way to save the chronometer's state or countup in the background on its own (or to perhaps keep track of the time on my own and update the chronometer visually at a different point in time)</p>
  
  <p>One idea I had was to start the Chronometer with a service and let the service keep counting , while having a textview in the existing activity update using the chronometer's current time tally as a string</p>
  
  <p>any insight on a known approach to this problem be appreciated! </p>
  
  <p>This is further complicated because this is an activity in a tabhost, and tabhosts call both onPause and onResume every time you load a view, so this breaks lifecycle functions.</p>