Could you try call Thread.run(). I did as you and works fine.
This is my example:
if(this.getState().equals(Thread.State.NEW)){
start();
} else if(this.getState().equals(Thread.State.TERMINATED)) {
this.run();
}
All operation I do in Thread class.
On 17 Лис, 21:27, Kumar Bibek <[email protected]> wrote:
> You cannot wake a dead thread. You can only resume a thread if it's in
> wait/blocked
> statehttp://www.roseindia.net/java/thread/life-cycle-of-threads.shtml
>
> On Thu, Nov 18, 2010 at 12:55 AM, MobileVisuals
> <[email protected]>wrote:
>
>
>
>
>
>
>
>
>
> > I have a thread in my app. Before it has been started, it has the
> > thread state NEW. I can then start it without problems. The user can
> > then start another app and then swith back to may app. onResume() and
> > onPostResume() then gets called in the activity and surfaceCreated()
> > gets called in the SurfaceView.
>
> > The thread then has the thread state TERMINATED. I want to wake it up
> > now, but I can not start it, because I get IllegalThreadStateException
> > then. This is because the thread has been started before.
>
> > I have tried other ways of waking it up, like interrupt (), but it
> > doesn't work. So how can I wake up the thread, so my application can
> > start functioning again?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%2Bunsubs
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en