Stay organized with collections
Save and categorize content based on your preferences.
Callback
abstract class Callback
Used for receiving notifications when GNSS events happen.
Summary
Public methods |
open Unit |
Called when the GNSS system has received its first fix since starting.
|
open Unit |
Called periodically to report GNSS satellite status.
|
open Unit |
Called when GNSS system has started.
|
open Unit |
Called when GNSS system has stopped.
|
Public constructors
Public methods
onFirstFix
open fun onFirstFix(ttffMillis: Int): Unit
Called when the GNSS system has received its first fix since starting.
Parameters |
ttffMillis |
Int: the time from start to first fix in milliseconds. |
onSatelliteStatusChanged
open fun onSatelliteStatusChanged(status: GnssStatus): Unit
Called periodically to report GNSS satellite status.
Parameters |
status |
GnssStatus: the current status of all satellites. This value cannot be null . |
onStarted
open fun onStarted(): Unit
Called when GNSS system has started.
onStopped
open fun onStopped(): Unit
Called when GNSS system has stopped.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# GnssStatus.Callback\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCallback\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/location/GnssStatus.Callback \"View this page in Java\") \n\n```\nabstract class Callback\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.location.GnssStatus.Callback](#) |\n\nUsed for receiving notifications when GNSS events happen.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------|---|\n| [Callback](#Callback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onFirstFix](#onFirstFix(kotlin.Int))`(`ttffMillis:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called when the GNSS system has received its first fix since starting. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSatelliteStatusChanged](#onSatelliteStatusChanged(android.location.GnssStatus))`(`status:` `[GnssStatus](/reference/kotlin/android/location/GnssStatus)`)` Called periodically to report GNSS satellite status. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStarted](#onStarted())`()` Called when GNSS system has started. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStopped](#onStopped())`()` Called when GNSS system has stopped. |\n\nPublic constructors\n-------------------\n\n### Callback\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nCallback()\n```\n\nPublic methods\n--------------\n\n### onFirstFix\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onFirstFix(ttffMillis: Int): Unit\n```\n\nCalled when the GNSS system has received its first fix since starting.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `ttffMillis` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the time from start to first fix in milliseconds. |\n\n### onSatelliteStatusChanged\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onSatelliteStatusChanged(status: GnssStatus): Unit\n```\n\nCalled periodically to report GNSS satellite status.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------|\n| `status` | [GnssStatus](/reference/kotlin/android/location/GnssStatus): the current status of all satellites. This value cannot be `null`. |\n\n### onStarted\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onStarted(): Unit\n```\n\nCalled when GNSS system has started. \n\n### onStopped\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onStopped(): Unit\n```\n\nCalled when GNSS system has stopped."]]