The Android Developer Challenge is back! Submit your idea before December 2.

NavigationState

public final class NavigationState
extends Object implements VersionedParcelable

java.lang.Object
   ↳ androidx.car.cluster.navigation.NavigationState


Navigation state data to be displayed on the instrument cluster of a car. This is composed by:

  • a list of destinations.
  • the immediate step or steps in order to drive towards those destinations.
This information can converted it to/from a Parcelable by using toParcelable() and fromParcelable(Parcelable), in order to be used in IPC (see Parcel).

Summary

Nested classes

class NavigationState.Builder

Builder for creating a NavigationState  

enum NavigationState.ServiceStatus

Possible service states  

Public methods

boolean equals(Object o)
static NavigationState fromParcelable(Parcelable parcelable)

Creates a NavigationState based on data stored in the given Parcelable

Segment getCurrentSegment()

Returns the current segment being driven, or null if the segment being driven is unknown.

List<Destination> getDestinations()

Returns an unmodifiable list of destinations and intermediate stops in the navigation, sorted from nearest to furthest.

NavigationState.ServiceStatus getServiceStatus()

Returns the service status (e.g.: normal operation, re-routing in progress, etc.).

List<Step> getSteps()

Returns an unmodifiable list of navigation steps, in order of execution.

int hashCode()
Parcelable toParcelable()

Returns this NavigationState as a Parcelable

String toString()

Inherited methods

Public methods

equals

public boolean equals (Object o)

Parameters
o Object

Returns
boolean

fromParcelable

public static NavigationState fromParcelable (Parcelable parcelable)

Creates a NavigationState based on data stored in the given Parcelable

Parameters
parcelable Parcelable

Returns
NavigationState

getCurrentSegment

public Segment getCurrentSegment ()

Returns the current segment being driven, or null if the segment being driven is unknown.

Returns
Segment

getDestinations

public List<Destination> getDestinations ()

Returns an unmodifiable list of destinations and intermediate stops in the navigation, sorted from nearest to furthest.

Returns
List<Destination>

getServiceStatus

public NavigationState.ServiceStatus getServiceStatus ()

Returns the service status (e.g.: normal operation, re-routing in progress, etc.).

Returns
NavigationState.ServiceStatus

getSteps

public List<Step> getSteps ()

Returns an unmodifiable list of navigation steps, in order of execution. It is up to the producer to decide how many steps in advance will be provided.

Returns
List<Step>

hashCode

public int hashCode ()

Returns
int

toParcelable

public Parcelable toParcelable ()

Returns this NavigationState as a Parcelable

Returns
Parcelable

toString

public String toString ()

Returns
String