If I try to execute an asynce task twice I get an illegal state exception.
07-29 18:14:21.290: ERROR/AndroidRuntime(9080): FATAL EXCEPTION: main
07-29 18:14:21.290: ERROR/AndroidRuntime(9080): java.lang.IllegalStateException: Cannot execute task: the task has already been executed (a task can be executed only once)
07-29 18:14:21.290: ERROR/AndroidRuntime(9080): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:541)
07-29 18:14:21.290: ERROR/AndroidRuntime(9080): at android.os.AsyncTask.execute(AsyncTask.java:499)
I can overcome it by creating another object of the async task. But this begs a question- Why can't I execute an async task twice? Is it because it the async task is like a thread? This also got me wondering why can't I run a thread twice? Why was the JAVA framework made in this manner?