Original Post
Ive read that stop() is deprecated, but its not reacting to interrupt or suspend either.
So I extended an AsyncTask class and overrode some methods.
Ive read that this while( running) magic is like "killing the thread manually".
Is there any better solution? I think that a while looping continuously in the background is not too efficient.
(Plus: could somebody tell me what exactly thread.join() does?
"[color=#000000]Blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping."
...yes, sure:))
Thanks!
..................................................
public void stop(){
running= false;
}
public void pause(){
paused= true;
}
public void resume(){
paused= false;
}
@Override
protected String doInBackground(Integer... params) {
running= true;
paused= false;
while(running){
if( paused){
...do nothing
}
else{
....do stuff
}
}
return null;
}
So I extended an AsyncTask class and overrode some methods.
Ive read that this while( running) magic is like "killing the thread manually".
Is there any better solution? I think that a while looping continuously in the background is not too efficient.
(Plus: could somebody tell me what exactly thread.join() does?
"[color=#000000]Blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping."
...yes, sure:))
Thanks!
..................................................
public void stop(){
running= false;
}
public void pause(){
paused= true;
}
public void resume(){
paused= false;
}
@Override
protected String doInBackground(Integer... params) {
running= true;
paused= false;
while(running){
if( paused){
...do nothing
}
else{
....do stuff
}
}
return null;
}