I have a GPS class which returns the current GPS coordinates to the calling activity via a callback.
The user either takes a picture or chooses one from the library and then returns to the main activity. After he returns to the main activity, I poll the gps class for the location data.
Once the callback return, it updates two class properties, one for Lat and one for Lon.
Sometimes it takes several second for the callback to be called and I want the activity to wait for the callback and display some kind of dialog to the user.
I am just using a while loop to wait for the properties to update, but I’m sure there is a more graceful solution to this.
use threading: