Error in doBackground AsyncTask?
<p>I keep getting a error in my doInBackground()</p>

<pre><code>07-20 21:05:20.859: ERROR/AndroidRuntime(3289): java.lang.RuntimeException: An error occured while executing doInBackground()


07-20 21:05:20.859: ERROR/AndroidRuntime(3289): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
</code></pre>

<p>Here is my asyncTask method.</p>

<pre><code>                private class MyTask extends AsyncTask&lt;Void, Void, Void&gt;{


                @Override
                protected Void doInBackground(Void... arg0) {try {
                            getImages();
                            Log.v("MyTask", "Image 1 retreived");
                            getImage2();
                            Log.v("MyTask", "Image 2 retreived");
                            getImage3();
                            Log.v("MyTask", "Image 3 retreived");
                            getImage4();
                            Log.v("MyTask", "Image 4 retreived");
                        } catch (IOException e) {
                            Log.e("MainMenu retreive image", "Image Retreival failed");
                            e.printStackTrace();
                        }
                    return null;
                }

                protected Void onPostExecute(){
                    ((Gallery) findViewById(R.id.gallery))
                            .setAdapter(new ImageAdapter(MainMenu.this));
                    return null;

                }

                        }

}
</code></pre>

<p>And its still holding up my UI for some reason. the UI doesnt appear till after its done.</p>

<p>Here is my onCreate() where i execute the AsyncTask.</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


MyTask myTask = new MyTask();

    myTask.execute();

}
</code></pre>
