I am trying to launch maps using the following code.
public static void navigate(Context context, double lat, double lon) {
String locationQuery = lat + "," + lon;
Uri gmmIntentUri = Uri.parse("google.navigation:q=" + locationQuery);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
context.startActivity(mapIntent);
}
But in certain cases I am getting no activity found to handle intent crash. What I am doing wrong here.