Mapbox - I implemented the onNavigationFinished() method in android studio using the mapbox navigation UI

I am a beginner at coding so please help.

i found this at https://docs.mapbox.com/android/navigation/overview/user-interaction/

So basically i want it to send me to another activity, but it doesnt seem to call the onNavigationFinished method

@Override
public void onNavigationFinished() {
    SendUserToPostActivity();
}

private void SendUserToPostActivity() {
    Intent postIntent = new Intent(RouteActivity.this, PostActivity.class);
    postIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
    startActivity(postIntent);
    finish();
}

mapbox screenshot

1 Answers

2
Aabauser On Best Solutions

By implements NavigationListener in your activity or fragment sample code https://docs.mapbox.com/android/navigation/examples/navigationview-with-fragment/