title: How to use intent in Asynctask class?
body: <p>Please share how to use intent in doinbackground() or onpostexecute() methods Asynctask class.When I tried to use these codes it shows error.</p>
  
  <pre><code>Intent intent = new Intent(asynctask.this, home.class);
  startActivity(intent);
  finish();
  
  private Class&lt;Home&gt; clazz;
          public asynctask(Class&lt;Home&gt; clazz){
              this.clazz = clazz;
          }
  </code></pre>
  
  <p><strong>Asynctask doInBackground() method:</strong>  </p>
  
  <pre><code>  protected Void doInBackground(Void... arg0) {
          // TODO Auto-generated method stub
          Intent intent = new Intent(this, clazz);
          startActivity(intent);
          finish();
          Toast.makeText(cxt, "welcome", Toast.LENGTH_SHORT).show();
          return null;
      }
  </code></pre>