title: Should I use getApplicationContext or Activity.this in a long running AsyncTask
body: <p>I have a long running Async Task that sends some data to my server and then stops. The whole process may involve a few requests and response. I have to read data from database, send it and handle the response and update my database accordingly. I am using content providers to read and update data from database.</p>
  
  <p>Now to use the Content Provider, I have to call the <code>getContentResolver()</code> method on context. So I am wondering whether I have to use <code>getApplicationContext</code> or just pass the <code>Activity.this</code> to my methods. </p>
  
  <p>I saw a few posts <a href="https://stackoverflow.com/questions/1026973/android-whats-the-difference-between-the-various-methods-to-get-a-context">like this</a> explaining the difference between the two and in most of them they advice us to not use <code>getApplicationContext</code> if possible. Although I do not want my <code>AsyncTask</code> to lose the context from <code>Activity.this</code> when the <code>Activity</code> is destroyed or when orientation changes. So I am wondering if I can use <code>getApplicationContext</code> in my case or will using <code>Activity.this</code> fit my requirement.</p>