Monday, October 1, 2012

[android-developers] On Tap event Maps

Hi!

I'm using a OnTap method, and I want to draw over Gmaps the route from where am I, to the point I'm pressing, after seeing all the points on the map.

Everything works perfectly, I have the location, I have the destination, but I dont know how to pass latitud and longitud, from the principal file.

protected boolean onBalloonTap(int i, OverlayItem item) {
Toast.makeText(c, "Calculando ruta... " ,Toast.LENGTH_LONG).show();
double latitudo = 43.250064;
double longitudo = -5.774496;
double latitudd = 43.223914;
double longitudd = -5.781582; 
String uri = "http://maps.google.com/maps?saddr="+latitudo+","+longitudo+"&daddr="+latitudd+","+longitudd+"&mode=walking";
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
c.startActivity(intent);
return true;

}

How can I pass from the principal file the value for latitudd, longitudd... Is it possible with one kind of bundle? 

Thanks for the answers!

Artemio

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate