title: Is it safe to pass variable that depends on a context to AsyncTask
body: <p>I have variable created in <code>onCreate()</code> like this:<br>
  <code>DataClient dataClient = Wearable.getDataClient(this)</code>    </p>
  
  <p>Then I pass this variable to my <strong>static AsyncTask</strong> in constructor. I use it in <code>doInBackground()</code>. As I understand - <strong>that's a leak</strong> (using context-depending variable in async task blocks GC from cleaning activity until task is finished).</p>
  
  <p><strong>Possible solution</strong> is to use weak reference to <code>dataClient</code>.<br>
  <strong>The problem with weak reference</strong> is that I heard you must not dereference it in <code>doInBackground()</code>, only in <code>onPostExecute()</code>, but I need it in <code>doInBackground()</code>.</p>
  
  <p>What can I do?  </p>