How do I ensure code is or is not executed on the UI thread in an Android MapActivity project?
I am developing an Android map-based application, but I have experienced some stability issues and my research has led me to believe I need to ensure that screen updates are carried out on the UI thread.
My app has data coming in from a GPS listener (which I would like to configure as a separate thread) and a UDP listener (which is already a separate thread), and it has the usual set of android software life cycle methods, but I must be inexperienced or something, because I have no idea where to put code that updates the map overlays
(a) on the UI thread,
(b) in a recurring manner.
I have no preference between a polling or an event-driven process (timer-based perhaps, or the arrival of incoming data), so suggestions of either type will be gratefully accepted.
Anyone got any ideas??
Thanks,
R.
Read this post on painless threading, particularly the Activity.runOnUIThread