这是我的代码,
private int V_Time = 1;
.
.
.
try {
final Timer V_Timer;
final Handler V_Handler;
V_Timer = new Timer();
V_Handler = new Handler(Looper.getMainLooper());
V_Timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
V_Handler.post(new Runnable() {
public void run() {
webservice_method();
V_Time = 2;
}
});
}
}, 0, V_Time * 1000 * 60);
} catch (Exception hata) {
}
V_time改变了从Web服务返回的内容,它似乎在日志中,它每分钟运行一次。如何设置programmitacally来自Web服务?
Ps:我试过了private long V_Time = 1;
,private static long V_Time = 1;
等等......
编辑:我可以使用cancel()
run()
等吗?在某个地方?