Illegalthreadstateexception Thread Already Started Occurs When Using Thread.start In A For Loop In Java On Android
I am using a FOR loop which has been designed to start the thread again on every iteration. The thread is used to extract data from text files. The error occurs on the second iter
Solution 1:
First off- a thread cannot be run twice. You need to create a new thread object and run it if you want to run 2 in parallel or run it again.
Secondly- if you do a thread.start immediately followed by a thread.join, the thread is pointless. I realize this may just have been debug code, but if it isn't you have some architecture problems here.
Post a Comment for "Illegalthreadstateexception Thread Already Started Occurs When Using Thread.start In A For Loop In Java On Android"