Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***
- * This task waits for the Location Services helper to acquire a location in a worker thread
- * so that we don't lock the UI thread whilst waiting.
- *
- * @author Scott Helme
- */
- class LocationWorker extends AsyncTask<Boolean, Integer, Boolean> {
- @Override
- protected void onPreExecute() {}
- @Override
- protected void onPostExecute(Boolean result) {
- /* Here you can call myLocationHelper.getLat() and
- myLocationHelper.getLong() to get the location data.*/
- }
- @Override
- protected Boolean doInBackground(Boolean... params) {
- //while the location helper has not got a lock
- while(myLocationHelper.gotLocation() == false){
- //do nothing, just wait
- }
- //once done return true
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement