timerUploadTime = new Timer();
timerUploadTimeTask = new TimerTask() {
@Override public void run() {
mHandler.post(new Runnable() {
@Override
public void run() {
...
}
}
});
}
};
timerUploadTime.schedule(timerUploadTimeTask, 1, Integer.parseInt(Utils.loadStringValue(mycontext, "refresh")));
I’d like to change my timer’s interval, in an other code segment. Is there a way to do that?
I dont want to retiming my code, i would like to add a new “period” interval.
How can I do that after schedule?
You can’t. You’ll have to cancel the current task and reschedule.