I am currently testing the wear 2.0 capabilities, and decided to go through the new maps implementation.
I tried to launch a quite basic navigation intent from the info window click of a marker, but the app keeps crashing with an unexpectedly weird error.
my code:
@Override
public void onMapReady(GoogleMap googleMap) {
// Map is ready to be used.
mMap = googleMap;
// Set the long click listener as a way to exit the map.
mMap.setOnMapLongClickListener(this);
mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
@Override
public void onInfoWindowClick(Marker marker) {
Uri gmmIntentUri = Uri.parse("google.navigation:q=" + marker.getPosition().latitude+","+marker.getPosition().longitude);
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
startActivity(mapIntent);
}
});
// Add a marker in Sydney, Australia and move the camera.
LatLng sydney = new LatLng(-34, 151);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
the error i keep getting:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=google.navigation:q=-34.0,151.0 }
Am i doing something wrong? running on a wear 2.0 android O emulator.
The Wear 2.0 maps system didn't include navigation per se, that's why it crashed. Apparently it's getting added in the upcoming Watch OS.