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);
How to toast a simple message when you walk into a Geofence?
Need help debugging SSLHandshakeException in Android Nougat
Occluded child view's in LinearLayout in ScrollView
Send frame data of camera (camera2 api) from one phone and display on another phone using WiFi Direct
Android Retrofit Post Issue
Azure Notification Hub no longer accepting GCM API Key
How do I find the version number of the library I am using intellij ant builds for my android application?
FloatingActionButton to launch new activity
GetFieldID fails on Android 4.4 and older
Prevent HorizontalScrollView to be accessed from anywhere on the screen
Android NDK: undefined reference to 'stderr'
Parallax effect in CollapsingToolbarLayout doesn't work anymore in buildToolsVersion “24.0.2”
Android Volley always fails with Proguard
Issues with SKMaps with certain devices
BLE Discover Diffrent Custom Service on OnePlue Device
Android Studio - set build directory globally (per machine)