From: Eugene Crosser Date: Thu, 2 Feb 2012 14:13:11 +0000 (+0400) Subject: compute distance works X-Git-Url: http://average.org/gitweb/?a=commitdiff_plain;h=b6c7f6d70cd87f9d3b8b7f6eaff05ea2d9efe816;p=WhereAmI.git compute distance works --- diff --git a/src/org/average/whereami/LastLocation.java b/src/org/average/whereami/LastLocation.java index 914a615..b710e16 100644 --- a/src/org/average/whereami/LastLocation.java +++ b/src/org/average/whereami/LastLocation.java @@ -36,7 +36,7 @@ public final class LastLocation extends Oracle { loc_names = res.getStringArray(R.array.loc_names); loc_lats = res.getStringArray(R.array.loc_lats); loc_lons = res.getStringArray(R.array.loc_lons); - loc_lons = res.getStringArray(R.array.loc_dists); + loc_dists = res.getStringArray(R.array.loc_dists); HttpTransport transport = AndroidHttp.newCompatibleTransport(); JsonFactory jsonFactory = new JacksonFactory(); @@ -103,11 +103,11 @@ public final class LastLocation extends Oracle { Double.parseDouble(loc_lons[i])); Log.v(TAG, "Dist from " + loc_names[i] + " is " + dist); - //if ((loc_dists[i] == "0") || - // (dist < Double.parseDouble(loc_dists[i]))) { - // locmsg = loc_names[i]; - // break; - //} + if ((loc_dists[i] == "0") || + (dist < Double.parseDouble(loc_dists[i]))) { + locmsg = loc_names[i]; + break; + } } return locmsg; }