title: Create class extend AsyncTask without leaking context object in Android Kotlin
body: <p>I defined a base class extends <code>AsyncTask</code> and have some custom method. I want to create some child classes which <code>extend</code> this, and <code>override</code> some methods. But by this way, its field will leaks the <code>Context</code> object.</p>
  
  <pre><code>abstract class ParentTask(context: Context) : AsyncTask&lt;Void, Int, String&gt;() 
  {
      ...
      override fun doInBackground(vararg params: Void): String? {
          ...
      }
      ...
  }
  </code></pre>
  
  <p>Please tell me why and show me how to implement it in Android Kotlin? I'm very appreciated if there's an example about this.
  p/s : I'm searched for this but can't understand. Why using Singleton, or other design pattern</p>