title: Android: Best practice for AsyncTask when Activity ends
body: <p>I use AsyncTasks in several places to do lengthy database queries and then fill in the resulting data Views in PostExecute. But by the time it gets there, the user could have switched screens (fragments) in my app or even "exited" the app back to the launcher.</p>
  
  <p>Right now I use a somewhat kludgey method so that the AsyncTask can check to see if the Activity's still alive before making the updates. But is this really necessary? It seems like as long as the task is active that the various View objects still exist, so updating them, while useless, will not hurt anything.</p>
  
  <p>Anyone have some ideas on coordinating the action of AsyncTasks in this regard?</p>