I need to navigate via an andress, or to converte my adress into lat&long for use in the uri...
Anyone know how do I do it ?
@Override
public void onClick(View v) {
String uri = String.format(Locale.ENGLISH, "http://maps.google.com/maps?daddr=%f,%f (%s)", 231, 321, "Where the party is at");
Intent MapsIntent= new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(uri));
MapsIntent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
try
{
startActivity(MapsIntent);
}
catch(ActivityNotFoundException ex)
{
try
{
Intent unrestrictedIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(unrestrictedIntent);
}
catch(ActivityNotFoundException innerEx)
{
Toast.makeText(getApplicationContext(),
"Nenhum aplicativo de navegação instalado!", Toast.LENGTH_LONG).show();
}
}
}
});