# GnssNavigationMessage.Callback

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Callback

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/location/GnssNavigationMessage.Callback "View this page in Java")  

```
abstract class Callback
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                     ||
| ↳ | [android.location.GnssNavigationMessage.Callback](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#) |

Used for receiving GNSS satellite Navigation Messages from the GNSS engine.

You can implement this interface and call android.location.LocationManager#registerGnssNavigationMessageCallback.

## Summary

|                                                                                                                                                                  Constants                                                                                                                                                                   ||
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_LOCATION_DISABLED](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#STATUS_LOCATION_DISABLED:kotlin.Int) GNSS provider or Location is disabled, updated will not be received until they are enabled. |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_NOT_SUPPORTED](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#STATUS_NOT_SUPPORTED:kotlin.Int) The system does not support tracking of GNSS Navigation Messages.                                   |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_READY](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#STATUS_READY:kotlin.Int) GNSS Navigation Messages are successfully being tracked, it will receive updates once they are available.           |

|                                                         Public constructors                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------|---|
| [Callback](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#Callback())`()` <br /> |

|                                                                                                                                                                                                                                 Public methods                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onGnssNavigationMessageReceived](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#onGnssNavigationMessageReceived(android.location.GnssNavigationMessage))`(`event:` `[GnssNavigationMessage](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage)!`)` Returns the latest collected GNSS Navigation Message. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStatusChanged](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#onStatusChanged(kotlin.Int))`(`status:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns the latest status of the GNSS Navigation Messages sub-system.                                                                                 |

## Constants

### STATUS_LOCATION_DISABLED

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val STATUS_LOCATION_DISABLED: Int
```

**Deprecated:** *Do not use.*

GNSS provider or Location is disabled, updated will not be received until they are enabled.  

    Value: 2

### STATUS_NOT_SUPPORTED

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val STATUS_NOT_SUPPORTED: Int
```

**Deprecated:** *Do not use.*

The system does not support tracking of GNSS Navigation Messages. This status will not change in the future.  

    Value: 0

### STATUS_READY

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val STATUS_READY: Int
```

**Deprecated:** *Do not use.*

GNSS Navigation Messages are successfully being tracked, it will receive updates once they are available.  

    Value: 1

## Public constructors

### Callback

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
Callback()
```

## Public methods

### onGnssNavigationMessageReceived

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onGnssNavigationMessageReceived(event: GnssNavigationMessage!): Unit
```

Returns the latest collected GNSS Navigation Message.  

### onStatusChanged

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onStatusChanged(status: Int): Unit
```

**Deprecated:** *Do not rely on this callback. From Android S onwards this callback will be invoked once with[STATUS_READY](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#STATUS_READY:kotlin.Int)in all cases for backwards compatibility, and then never invoked again. Use LocationManager APIs if you need to determine if GNSS navigation messages are supported or if location is off, etc...*

Returns the latest status of the GNSS Navigation Messages sub-system.

|                                                                                                                                                                                                                                                                                                                                                  Parameters                                                                                                                                                                                                                                                                                                                                                  ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `status` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.location.GnssNavigationMessage.Callback#STATUS_NOT_SUPPORTED](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#STATUS_NOT_SUPPORTED:kotlin.Int),[android.location.GnssNavigationMessage.Callback#STATUS_READY](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#STATUS_READY:kotlin.Int), or[android.location.GnssNavigationMessage.Callback#STATUS_LOCATION_DISABLED](https://developer.android.com/reference/kotlin/android/location/GnssNavigationMessage.Callback#STATUS_LOCATION_DISABLED:kotlin.Int) |