In my Activity I create a Thread for multiply objects and "save" them to a hashmap. Is it possible to pause just a single thread of the hasmap and continue it?
public void onCreate(Bundle savedInstanceState) {
Thread oThread = new Thread(new Runnable() {
public void run() {
while (true) {
// doing some work
}
}
}
oThread.start();
aThreads.put(name, oThread);
}
public void anyMethod(){
// here I want to start and continue a thread
aThreads.get(name).stop();
aThreads.get(name).resume();
}
But .stop() and .resume() aren't working :/ any suggestions?