I am trying to call an external application Google Mapsfrom my application Android.
Intent mIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" + stringLatitude + "," + stringLongitude + "&daddr=" + latitud + "," + longitud+"&dirflg=d"));
startActivity(mIntent);
It works great on Android 2.3.6.
But not on Android 4.2, the first time I press the button that runs this code Google Maps, it opens correctly, but nothing is displayed about the driving mode.
But as soon as I return to the main application, I press the button again, everything works fine. This only happens on the first try.
I can not understand what is happening
Any clue?
source
share