Stay organized with collections Save and categorize content based on your preferences.
Defines an interface for providing location data, typically to a GoogleMap
object.
A GoogleMap
object has a built-in location provider for its my-location layer, but it can be replaced
with another one that implements this interface.
A GoogleMap
object activates its location provider using activate(OnLocationChangedListener)
. While active (between activate(OnLocationChangedListener)
and deactivate()
), a location provider should push periodic location updates to the listener registered in activate(OnLocationChangedListener)
. It is the provider's responsibility to use location services wisely according to the map's lifecycle state. For example, it should only using battery-intensive services (like GPS) occasionally, or only while an activity is in the foreground.
Activates this provider. This provider will notify the supplied listener periodically, until you call deactivate()
. Notifications will be broadcast on the main thread.
Deactivates this provider. The previously-registered callback is not notified of any further updates.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 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 2024-10-31 UTC."],[[["`LocationSource` provides location data, often to a `GoogleMap` object, offering an alternative to the built-in location provider."],["This interface uses `activate()` and `deactivate()` methods to manage the location provider's lifecycle and push location updates."],["When activated, the provider sends periodic location updates to a registered listener, ensuring efficient use of location services."],["Developers implementing `LocationSource` should consider the map's lifecycle to optimize battery consumption and resource usage."],["The `OnLocationChangedListener` nested interface handles location updates broadcasted on the main thread."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4