Unable to set variable values inside the timer function Please Login to Remove! Hi
i am utilising the timer event to get the value from a text box and storing it into a variable after saving the previous value onto another variable
Timer timer = new Timer();
TimerTask updateTask;
String prevEntry;
String crntEntry;
updateTask = new TimerTask() {
public void run() {
prevEntry = crntEntry;
crntEntry = field1.gettext();
}
}
where field1 is declared as BasicEditField
But I am getting errors like
local variable crntEntry is accessed from within inner class; needs to be declared final
prevEntry = crntEntry;
^ |