问题
Here is my code,
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 changes what returns from web service, it seems right in logs altough, it runs every minute. How can set it programmitacally what come form web service?
Ps: I tried private long V_Time = 1;
, private static long V_Time = 1;
etc...
edit:Can I use cancel()
run()
etc..? in somewhere?
来源:https://stackoverflow.com/questions/16709439/timer-time-does-not-change-as-variable