我想要做的是延迟15秒的while循环,在循环内我想执行凌空请求..循环正在工作但没有延迟
这是我的代码:(client2 是凌空请求方法)
new Thread(new Runnable() {@Override
public void run() {
while (h < taxiidlist.size() && assined == false && requested == true) {
handler2.post(new Runnable() {@Override
public void run() {
client2(user.id, taxiidlist.get(h));
h++;
}
});
try {
Thread.sleep(15000);
} catch(InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();