Merge pull request #609 from tekkies/fix-url-daddr-intent

Fix http://maps.google.com/?daddr= intent
This commit is contained in:
vshcherb 2014-04-17 17:41:58 +02:00
commit 439ba4bf8f

View file

@ -200,10 +200,14 @@ public class GeoIntentActivity extends OsmandListActivity {
*/
private MyService extract(Uri data) {
if ("http".equalsIgnoreCase(data.getScheme()) && "maps.google.com".equals(data.getHost())) {
String q = data.getQueryParameter("q").split(" ")[0];
if (q.indexOf(',') == -1) {
q = data.getQueryParameter("daddr").split(" ")[0];
}
String q = null;
String parameter = data.getQueryParameter("q");
if (parameter == null) {
parameter = data.getQueryParameter("daddr");
}
if(parameter != null) {
q = parameter.split(" ")[0];
}
if (q.indexOf(',') != -1) {
int i = q.indexOf(',');
String lat = q.substring(0, i);