我其中有一个计时器运行任务的Android应用程序:如何在一定时间后停止计时器?
time2.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
sendSamples();
}
}, sampling_interval, sending_interval);
比方说sampling_interval是2000年和sending_interval是4000
因此,在这个应用程序,我送一些阅读值从传感器到服务器。但是我想在10000(10秒)后停止发送。
我该怎么办?
http://stackoverflow.com/questions/11489988/how-to-stop-a-timer-after-certain-number-有时候 – gks 2013-04-09 06:41:09