AARouteCallback

interface AARouteCallback

Callback interface for Android Auto route preview and destination selection events.

This interface handles all route-related interactions on Android Auto: destination selection from search, route selection from alternatives, route cancellation, and map recentering on the route.

Responsibility

Manages route preview events:

  • Destination selection from search results

  • Route alternative selection

  • Route preview cancellation

  • Map recentering on route bounding box

Callers

Methods in this interface are called by:

Route Flow

  1. User searches for destination → selects result → onDestinationSelected

  2. Routes are computed and displayed → user selects alternative → onAARouteSelected

  3. User can recenter map on route → onAARecenterOnRoute

  4. User can cancel route preview → onAARouteCancelled

Usage

class MyCallback : AARouteCallback {
override fun onDestinationSelected(latitude: Double, longitude: Double, title: String) {
// Show POI marker, compute routes
}

override fun onAARouteSelected(index: Int) {
// Update selected route polyline
}

override fun onAARouteCancelled() {
// Clear routes, return to map view
}

override fun onAARecenterOnRoute() {
// Fit map to route bounding box
}
}

See also

Inheritors

Functions

Link copied to clipboard
abstract fun onAARecenterOnRoute()

Called when user presses the recenter button on Android Auto route preview screen.

Link copied to clipboard
abstract fun onAARouteCancelled()

Called when user cancels route preview on Android Auto.

Link copied to clipboard
abstract fun onAARouteSelected(index: Int)

Called when user selects a route on Android Auto route preview screen.

Link copied to clipboard
abstract fun onDestinationSelected(latitude: Double, longitude: Double, title: String)

Called when user selects a destination on Android Auto search screen.