aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps/cache/navi
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-11-09 16:58:36 +0100
committerSamuel Tardieu <sam@rfc1149.net>2011-11-09 17:59:05 +0100
commitbcbb6f97db2bc560305283c2291b828b2e372bb9 (patch)
tree40ae84a08c64c6db524155ed719479757e68ff9c /main/src/cgeo/geocaching/apps/cache/navi
parentae1fd0ffc874998e3e2bf45e4e345d5702c0faf4 (diff)
downloadcgeo-bcbb6f97db2bc560305283c2291b828b2e372bb9.zip
cgeo-bcbb6f97db2bc560305283c2291b828b2e372bb9.tar.gz
cgeo-bcbb6f97db2bc560305283c2291b828b2e372bb9.tar.bz2
Use GeopointFormatter instead of String.format when coordinates are around
Some predefined formats have been added to fill the needs. This closes issue #769.
Diffstat (limited to 'main/src/cgeo/geocaching/apps/cache/navi')
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java b/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java
index cb0b520..bc88853 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java
@@ -6,13 +6,13 @@ import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgSearch;
import cgeo.geocaching.cgWaypoint;
import cgeo.geocaching.geopoint.Geopoint;
+import cgeo.geocaching.geopoint.GeopointFormatter.Format;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import java.util.ArrayList;
-import java.util.Locale;
class RMapsApp extends AbstractNavigationApp {
@@ -34,20 +34,12 @@ class RMapsApp extends AbstractNavigationApp {
if (isInstalled(activity)) {
final ArrayList<String> locations = new ArrayList<String>();
if (cache != null && cache.getCoords() != null) {
- locations.add(String.format((Locale) null, "%.6f",
- cache.getCoords().getLatitude())
- + ","
- + String.format((Locale) null, "%.6f",
- cache.getCoords().getLongitude())
+ locations.add(cache.getCoords().format(Format.LAT_LON_DECDEGREE_COMMA)
+ ";"
+ cache.getGeocode()
+ ";" + cache.getName());
} else if (waypoint != null && waypoint.getCoords() != null) {
- locations.add(String.format((Locale) null, "%.6f",
- waypoint.getCoords().getLatitude())
- + ","
- + String.format((Locale) null, "%.6f",
- waypoint.getCoords().getLongitude())
+ locations.add(waypoint.getCoords().format(Format.LAT_LON_DECDEGREE_COMMA)
+ ";"
+ waypoint.getLookup()
+ ";" + waypoint.getName());