gps - Open navigation activity directly of deafault android map programmatically - Android -


Hi, I am using the following code to show the user direction between my current location and its car location.

string uri = string.format (locale.gnsih, "http://maps.google.com/maps?saddr=%f,%f(%s)&daddr=% F,% f (% s) ", curlat, curlong," your location ", carlat, carlong," your vehicle location "); Intent to intent = new intent (int. Action_ VIEW, Uri. PRSE (Yuri)); Intent.setClassName ("com.google.android.apps.maps", "com.google.android.maps.mapsActivity"); StartActivity;

It works well, but before entering the navigation activity, I have to press on Start Navigation. What I have to do, I need to enter the navigation activity without pressing the Start Navigation Button directly.

As you can see below the image on the left which I get first I click on the navigation button starting from the bottom, I will be taken to rotate by turn (image on the right) is. Is it possible to turn directly the turning navigation of the default Android app?

Enter the details of the image here

I have encountered this problem right now, and you can avoid the "button by changing the URI and clicking on" action "

  Late Long Destiny; // Your Destiny LatLng Object String Yuri = "google.navigation: q =% f ,% F "; Intent navIntent = new intent (Intent.ACTION_VIEW, Uri. PRSE (String. (Locale.US, Yuri, Didi.Latidad, Didini.Languitud)); if (Canhandle Intent (this, ninth)) Initial Activity (ninth); and Toast. Make Text (this, "Please Install Google Navigation", Then, ();  

After that, if you have many applications to deal with navigation processes and you want to go straight to Google navigation, Line with "setClassName" call for Programming can also include:

  intent.setClassName ( "com.google.android.apps.maps", "com.google.android.maps.MapsActivity");  

Hope this helps;)


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -