As a total noob to android programming I was advised to make use of adapters and handlers in order to update a textview periodically rather than thread/sleep.
However, I wonder why! Any suggestions?
As a total noob to android programming I was advised to make use of
Share
In Android, you can’t update a UI widget outside of the UI thread, so
Handlerprovides a way for aThreadto communicate with the UI. In this approach, you start your thread to generate the view data and pass it to theHandlervia aMessage. The handler then updates the UI according to the data you sent.I’m not sure exactly where an adapter would fit into the equation, since those are typically used to connect some data with a view (e.g.
ListViewandListAdapter).