Setting true for repeat parameter, the invokeLater() method continually re-adds the runnable object to the event queue, pausing the time (in my case, 10 sec) between each insertion.
Code:
public static int timeInterval=10000;
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
//code to print the list
}
}, timeInterval, true);
Now I need to change the timeInterval dynamically while running the application. Changes in global variable 'timeInterval' doesnot effect its execution because time is already set before executing the thread.
So, I think I need to kill the thread and restart again with new timeInterval. Is this the way to solve it ? What will be the good solution for this?
Romah