diff --git a/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/DefaultMilestones.java b/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/DefaultMilestones.java index c7d4e8068c6..9af43df1dfd 100644 --- a/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/DefaultMilestones.java +++ b/navigation/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/DefaultMilestones.java @@ -51,13 +51,14 @@ public String buildInstruction(RouteProgress routeProgress) { .setInstruction(new Instruction() { @Override public String buildInstruction(RouteProgress routeProgress) { - int legIndex = routeProgress.legIndex(); - int followUpStepIndex = routeProgress.currentLegProgress().stepIndex() + 2; + if (routeProgress.currentLegProgress().followOnStep() == null) { + return getInstructionString(routeProgress); + } return String.format(Locale.US, "%s then %s", getInstructionString(routeProgress), - convertFirstCharLowercase(routeProgress.directionsRoute().getLegs().get(legIndex) - .getSteps().get(followUpStepIndex).getManeuver().getInstruction()) - );// TODO fix this + convertFirstCharLowercase(routeProgress.currentLegProgress() + .followOnStep().getManeuver().getInstruction()) + ); } }) .setTrigger(