Hi, All:
In the code in chapter 4, on p. 175, the author keeps instantiating a new Runnable, everytime through the loop, to set the progress of the progress bar. Isn't that inefficient? i.e., why can't he just write:
progressStatus = doSomeWork();
progressBar.setProgress(progressStatus);
Instead of having to wrap the second line in a handler:
Code:
progressStatus = doSomeWork();
handler.post(new Runnable()
{
public void run(){
progressBar.setProgress(progressStatus);
}
});
Any insights would be appreciated.
Thanks,
Michael