Good day, I am writing a program that uses a UDP poort to listen to information send from a system. First the users sees an activity that allows them to close the activity or start it on a port they can select (edittext)
The port is checked and if correct a new activity is launched. This display a view items with the received information and a return button. When started the it also launches a thread for the UDP connection. In this thread there is a while loop that runs on a boolean value in the activity. The problems occurs when the user returns from the information screen to the login and logs in again. When they exit the information screens the following commands are called: active = false; //a while loop in the the thread ServerThread.serverInitialised = false; //a while loop in the thread InlogScherm.restart = false; //a value indicating if the users exits the program or it only lost focus finish(); // closes the current activity? When logged in again the activity crashes directly. After that you can log in, exit login, crash, login, exit, etc by adding the command thread.close the activity closes with an error screen (deprecated command). But a new login doesn't gives any errors so my guess is that the error is in the fact that the thread isn't closed. I can't find any way to close or destroy the thread and let it stop by stopping the while loop doesn't solves the crashes. Does anyone have an idea on how to solve this problem? (The code for the thread is in a different file) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en