Created
May 16, 2013 09:44
-
-
Save px-amaac/5590618 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected LatLng doInBackground(String... strings) { | |
assert( strings.length == 2 ); | |
String loc = strings[0]; | |
String vid = strings[1]; | |
mVenueId = Integer.parseInt(vid); | |
int count = -1; | |
try { | |
Date start = new Date(); | |
List<Address> la = mGC.getFromLocationName(loc, 1); | |
Date end = new Date(); | |
float ms = (end.getTime()-start.getTime()); | |
synchronized (LoadGeoCode.class) { | |
count = sGeoCount; | |
sGeoCount++; | |
} | |
Log.d( Global.LOG_TAG, "geocode " + count + ": " + ms + " ms" ); | |
if ( la.size() > 0 ) { | |
Address a = la.get(0); | |
LatLng ll = new LatLng(a.getLatitude(), a.getLongitude()); | |
mCGC.AddEntry( loc, ll ); | |
return ll; | |
} | |
} catch (IOException e) { | |
Log.e( Global.LOG_TAG, "geocode #" + count + " io exception" ); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment