http://stackoverflow.com/questions/10961714/how-to-properly-stop-the-thread-in-java


On Wednesday, 11 May 2016 16:53:47 UTC+1, Alex Kau wrote:
>
> I want to stop a running thread, but Thread.stop is deprecated :/ 
> Does anyone know a solution for this problem? The thread should only run 
> one time and than the thread stop.
> Thanks
>
> public class Updater implements Runnable {
>
>     Thread thread;
>
>
>     public Updater(){
>         thread = new Thread(this);
>     }
>
>     @Override
>     public void run(){
>         //Does anything
>         
>
>         
>     }
>
>     public void start(){
>         running = true;
>         this.thread.start();
>     }
>     public void stop(){
>         this.thread.stop(); //Error!!! 
>     }
>
> Code hier eingeben...
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/ca6068d7-6654-45ff-8a7e-e8334c6f822f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to