How to prompt the user to choose default navigation application
I have an app which let the user click on the address to start the navigation from his current position. For now it open Waze. But now I want to let user to choose between maps, waze and other navigation app installed and make one 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")); It let me choose but it not start the navigation, just a classique point on a map. What I want is to open the navigation of any app. for map it's : 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 it does not let the user which application to use. So is there a way to do that automatically ? if not what can be the alternative to let the user choose ?
Doing intent.setPackage("com.google.android.apps.maps"); you are forcing to use Google Maps. From the documentation: public Intent setPackage (String packageName) (Usually optional) Set an explicit application package name that limits the components this Intent will resolve to. If left to the default value of null, all components in all applications will considered. If non-null, the Intent can only match the components in the given application package. Just remove it: Uri gmmIntentUri = Uri.parse("google.navigation:q=Taronga+Zoo,+Sydney+Australia"); Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); startActivity(mapIntent); UPDATE: It seems that Waze responds to http://maps.google.com Intents, so you can achieve your desired functionality this way (does not work for 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);
Writing an app which can be updated across devices [closed]
yaw pitch roll of -Z axis from the android sensors
Starting an Activity First in Android?
How to darken a screen in android?
Android storing relative high amount of string_array in strings.xml
Android ListView with Style to the elements issue; after scroll style changes automatically
how can we print The name of activity in logcat
Create user profiles on the android device like we have accounts on PC
Android : Refresh View location after TranslateAnimation?
how to customise side indexer in android?
Store private data on external storage
issues in spinner Android?
I can't write into the EditText, it disappears when i try to write something, its because the getView() is called when i modify the data
How to cut a dynamic string [closed]
How to make a blocking Android HttpRequest
Android handler skip/jump a second