start gmaps directly in nav-mode. this way we get a labeled marker with locales using decimal comma separator too (thanks joerg wagner)

This commit is contained in:
Philipp Schaefer 2013-09-02 09:49:31 +02:00
parent 98f88b07e9
commit 00a703025e

View File

@ -79,19 +79,13 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
// we merge gmaps intents with geo intents since it is not possible // we merge gmaps intents with geo intents since it is not possible
// anymore to set a labeled marker on geo intents // anymore to set a labeled marker on geo intents
ArrayList<Intent> intents = new ArrayList<Intent>(); ArrayList<Intent> intents = new ArrayList<Intent>();
DecimalFormatSymbols decFormat = new DecimalFormatSymbols();
// thx to gmaps, this only works for the decimal point separator
String gMapsUri; String gMapsUri;
if (decFormat.getDecimalSeparator() == '.') try {
try { gMapsUri = "http://maps.google.com/?daddr=" + mLl + "%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")";
gMapsUri = "http://maps.google.com/maps?q=loc:" + mLl + } catch (UnsupportedEncodingException e) {
"%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")&z=" + mZoom; gMapsUri = "http://maps.google.com/?daddr=" + mLl;
} catch (UnsupportedEncodingException e) { e.printStackTrace();
gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom; }
e.printStackTrace();
}
else
gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom;
Intent gMapsIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(gMapsUri)); Intent gMapsIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(gMapsUri));
intents.add(gMapsIntent); intents.add(gMapsIntent);
String geoUri = "geo:" + mLl; String geoUri = "geo:" + mLl;