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:
AndroidAutoSearchScreen: onDestinationSelectedAndroidAutoRoutePreviewScreen: onAARouteSelected, onAARouteCancelled, onAARecenterOnRouteAndroidAutoNavigationScreen: onAARouteCancelled
Route Flow
User searches for destination → selects result → onDestinationSelected
Routes are computed and displayed → user selects alternative → onAARouteSelected
User can recenter map on route → onAARecenterOnRoute
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
Called when user presses the recenter button on Android Auto route preview screen.
Called when user cancels route preview on Android Auto.
Called when user selects a route on Android Auto route preview screen.
Called when user selects a destination on Android Auto search screen.