Waypoints List UI

Display a list of waypoints for the navigation route.

Assuming that there is an active navigation going on, we're going to fetch the current route and to display the corresponding waypoints.

TGNavigationRepository.getDefaultNavigationAdapter(CONTEXT, new TGNavigationRepository.AdapterCallback() {
  @Override
  public void onReady(@NonNull TGNavigationRepository.Adapter navAdapter) {
    // If we have an active navigation running...
    if( navAdapter.isNavRunning() ) {
      // Get the current route
      TGRoute currentRoute = navAdapter.getCurrentRoute();

      // Display the waypoints of the route
      TGLauncher.startWaypointsList(CONTEXT, currentRoute.getRouteId());
    }
    
    navAdapter.tearDown(); // We do not need the adapter anymore, so disconnecting
  }
});
Check out the Android Reference App to see this example in action.