以前用的是for循環(huán),但是此方法CPU占用太高,于是尋找新方法。試過定時器:TimerTask?task?=?new?TimerTask(){???
public?void?run(){???
????//execute?the?task?
????}
};
Timer?timer?=?new?Timer();
timer.schedule(task,?delay);和開啟新線程:new?Thread(new?Runnable(){
????public?void?run(){
????????Thread.sleep(XXXX);
????????handler.sendMessage();
????}
}).start但是程序是同時開了幾個新線程執(zhí)行,請問怎樣才能實現(xiàn)等待上一個操作結(jié)束再執(zhí)行下一個操作?
Android程序中如何實現(xiàn)延時操作?
Illustri0us
2015-03-08 17:03:13