How to make the user choose the default navigation application

I have an application that allows the user to click on an address to start navigation from its current position. Until he opens Waze . But now I want the user to be able to choose between maps, waze and another navigation application and set it by default.

I tried using:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(Locale.US, "geo:%.8f,%.8f", latitude, longitude)));
startActivity(Intent.createChooser(intent, "Select an application"));

Let me choose, but this is not the beginning of navigation, just a classic point on the map. I want to open the navigation of any application. for card:

Uri gmmIntentUri = Uri.parse("google.navigation:q=Taronga+Zoo,+Sydney+Australia");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

But this does not allow the user to use which application.

So, is there a way to do this automatically? if not, what could be an alternative to let the user choose?

+4
1

intent.setPackage("com.google.android.apps.maps");, Google. :

public Intent setPackage (String packageName)

( ). , , . null, . null, Intent .

:

Uri gmmIntentUri = Uri.parse("google.navigation:q=Taronga+Zoo,+Sydney+Australia");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
startActivity(mapIntent);

UPDATE:

, Waze http://maps.google.com Intents, ( iCoyote):

Uri gmmIntentUri = Uri.parse("http://maps.google.com/maps?q=Taronga+Zoo,+Sydney+Australia");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
startActivity(mapIntent);
0

All Articles