i am developing chat related similar application i am using backgrouund synchronous class some times force close is appear i am using .net webservices back ground i am recieve the messages and images background download process updating to ui
error is:
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): FATAL EXCEPTION: AsyncTask #1
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): java.lang.RuntimeException: An error occured while executing doInBackground()
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at android.os.AsyncTask$3.done(AsyncTask.java:200)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.lang.Thread.run(Thread.java:1096)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.ArrayList.get(ArrayList.java:311)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at com.fitzgeraldsoftware.shout.presentationLayer.Shout$LatestMessage.doInBackground(Shout.java:1923)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at android.os.AsyncTask$2.call(AsyncTask.java:185)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
05-17 05:24:17.925: ERROR/AndroidRuntime(1618): ... 4 more
05-17 05:24:17.956: WARN/ActivityManager(1105): Force finishing activity com.fitzgeraldsoftware.shout.presentationLayer/.Shout
05-17 05:24:18.097: WARN/IInputConnectionWrapper(1618): showStatusIcon on inactive InputConnection
You have
ArrayIndexOutOfBoundsExceptionthrown. Check the code executed on 1923 inShout.javafor array access. The exception is thrown if you try to read element by index which is more than array size(1). For example it is thrown if: