From 00a703025eb1764c53930524e92fdc93d33f3f5a Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 09:49:31 +0200 Subject: [PATCH] start gmaps directly in nav-mode. this way we get a labeled marker with locales using decimal comma separator too (thanks joerg wagner) --- .../iitc_mobile/share/ShareActivity.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java index 756d6b64..1bcf0b1f 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java +++ b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java @@ -79,19 +79,13 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList // we merge gmaps intents with geo intents since it is not possible // anymore to set a labeled marker on geo intents ArrayList intents = new ArrayList(); - DecimalFormatSymbols decFormat = new DecimalFormatSymbols(); - // thx to gmaps, this only works for the decimal point separator String gMapsUri; - if (decFormat.getDecimalSeparator() == '.') - try { - gMapsUri = "http://maps.google.com/maps?q=loc:" + mLl + - "%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")&z=" + mZoom; - } catch (UnsupportedEncodingException e) { - gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom; - e.printStackTrace(); - } - else - gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom; + try { + gMapsUri = "http://maps.google.com/?daddr=" + mLl + "%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")"; + } catch (UnsupportedEncodingException e) { + gMapsUri = "http://maps.google.com/?daddr=" + mLl; + e.printStackTrace(); + } Intent gMapsIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(gMapsUri)); intents.add(gMapsIntent); String geoUri = "geo:" + mLl;