lastKnowLocationState

Provides a State object that contains the last known location.

This function uses produceState to create a State object that contains the last known location. The location is retrieved asynchronously using LocationService.getLastKnownLocation.

Return

A State that represents the last known location. The initial value is LocationState.CurrentLocation with a null location.


Provides a State object that contains the last known location, with one recomposition key.

Return

A State that represents the last known location. The initial value is LocationState.CurrentLocation with a null location.

Parameters

key1

A key that can be used to force recomposition when it changes.


Provides a State object that contains the last known location, with two recomposition keys.

Return

A State that represents the last known location. The initial value is LocationState.CurrentLocation with a null location.

Parameters

key1

First key that can be used to force recomposition when it changes.

key2

Second key that can be used to force recomposition when it changes.


fun lastKnowLocationState(locationService: LocationService, key1: Any?, key2: Any?, key3: Any?): State<LocationState>

Provides a State object that contains the last known location, with three recomposition keys.

Return

A State that represents the last known location. The initial value is LocationState.CurrentLocation with a null location.

Parameters

key1

First key that can be used to force recomposition when it changes.

key2

Second key that can be used to force recomposition when it changes.

key3

Third key that can be used to force recomposition when it changes.


Provides a State object that contains the last known location, with a variable number of recomposition keys.

Return

A State that represents the last known location. The initial value is LocationState.CurrentLocation with a null location.

Parameters

keys

A variable number of keys that can be used to force recomposition when any of them change.