-2

I want to start Navigation from my activity. The requirement is that when the user clicks the directions button in my app it should start the Navigation app on Android device and show the directions from current position to the destination position.

I have done this for Maps, where I am displaying the directions on the map and launching the Map activity, but now I want to launch the navigation and, without any user interaction, to display the route with the from and to geo locations.

Adinia
  • 3,722
  • 5
  • 40
  • 58
Shax
  • 4,207
  • 10
  • 46
  • 62

1 Answers1

4

Here is the code you need:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=Berlin Germany")); 
startActivity(i);
Terel
  • 3,857
  • 1
  • 25
  • 28