Android AsyncTask & starting new Activities
<p>I've been having some issues with starting a new activity once an AsyncTask has completed.
I've read that I can put code like this:</p>

<pre><code>protected void onPostExecute(String result) {
    super.onPostExecute(result);
    if (progress.isShowing()) {
        if (result.equals("true")) {
            progress.dismiss();
            activity.startActivity(new Intent(activity, Main.class));
        }
    }
}
</code></pre>

<p>But basically that just crashes and it's always on the line which it's starting the Activity, It comes up with the error NullPointerException but I can't figure out why?</p>

<p>Any idea?</p>

<p>Thanks
Chris</p>
