I have a class that extends AsyncTask

```
public class MyClass extends AsyncTask<Void, Void, Void> {
    private String response;

    public String getResponse(){
        return response;
    }

    @Override
    protected Void doInBackground(Void... arg0) {
         /* code */
         return null;
    }
    @Override
    protected void onPostExecute(Void result) {
        response = aString;
        super.onPostExecute(result);
    }
}

```

In other activity, I create an instance of MyClass

```
 MyClass c = new MyClass();
 c.execute();
 response = c.getResponse();
 Toast.makeText(getApplicationContext(), "response = " + response, Toast.LENGTH_LONG).show();

```

However I got null on the response variable, maybe because the Toast was executed before the task finish. Could you give me the right way so I can get the result after the task finish?