ImageThread it = new ImageThread(this.imageURL,this);
Thread t = new Thread(it);
t.start();
I'm new to threads and had to implement the above in my field that loads an image, because it slowed down the UI thread.
Whether my threads are downloading an image or some json content, they appear to still be downloading even though the user has pushed a new mainscreen onto the uiapplication. This continuous loading could be a problem if a user enters a screen and then accesses another in quick succession. As a result, the last screen they are on only finishes its thread when the others are done.
What am I supposed to do with my threads that would be deemed responsible? I don't want my app to be bogged down by a queue of threads. How do I, say, cancel downloads on screen change?
I'm posting this question in Java since I think the process is the same.