title: How to create a Timer that updates a TextView from Activity and when the app goes background it keeps running
body: <p>I'm trying to figure it out how to do this, I'd like to create a timer from data that comes by server like : 3600 &lt;-- this comes from server, so I'd like to create a timer with this time and have a TextView that is updating it every 1 second and once the timer is done create a dialog, this is not necessary I know how to do it, but I'd like to do like if user put the app in background timer keeps running. </p>
  
  <p>What I thought is to create a <code>BroadcastService</code> and update from there the <code>TextView</code> and if the app goes on background in <code>onPause()</code> I should do something to keep running the timer, and also thought about if timer is done, add it to a SharedPreferences so I can know if the timer is finished or not (if the user had the app in background).</p>
  
  <p>How can I achieve this?</p>