所以我有以下线程:
public class MyThread extends Thread
{
Handler cHandler;
private boolean looprunning = false;
MyThread() {
cHandler = new Handler();
looprunning = true;
}
@Override
public void run(){
while (looprunning) {
//do stuff here
//update another system here or something else.
}
}
}
在该线程的 while 循环内,我想运行一个 Runnable,当线程在该 while 循环内循环时,我将其传递给线程。我该怎么做呢?