AsynchTask crashes on return from doInBackground
<p>I have the following code:</p>

<pre><code>public class TestSynch extends Activity {

public static ArrayList&lt;HashMap&lt;String,String&gt;&gt; list;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.splash);
    Context ctx = this.getApplicationContext();


    new ProcessFileTask().execute(ctx);

    Intent i = new Intent(TestSynch.this, ListSchools.class);
    i.setAction(Intent.ACTION_VIEW);
    i.putExtra("arraylist", list);
    startActivity(i);

}

private class ProcessFileTask extends AsyncTask&lt;Context, Void, ArrayList&lt;HashMap&lt;String,String&gt;&gt;&gt; {
    @Override
    protected ArrayList&lt;HashMap&lt;String,String&gt;&gt; doInBackground(Context... ctx) {

        ArrayList&lt;HashMap&lt;String,String&gt;&gt; threadList = FileOperations.getListAsMaps(ctx[0]);
        return threadList;
    }
    @Override
    protected void onPostExecute(ArrayList&lt;HashMap&lt;String,String&gt;&gt; result) {
         list = result;
        return;
    }
}
</code></pre>

<p>I can debug to the return threadList; line in doInBackground, and the ArrayList variable threadList is perfectly correct.</p>

<p>However, onPostExecute doesn't seem to get called and the Activity crashes on return from doInBackground, with LogCat suggesting a nullPointerException attempting to fire the Intent (which I have previously tested and worked ok before I started messing with AsynchTask)</p>

<p>Any idea why this is happening? The code seems simple enough...</p>

<p>Thanks</p>
