Reputation: 1286
I am currently showing the user's current location on the map with
setMyLocationEnabled(true);
Is there a callback or another way I can tell when the blue dot showing the current location appears on the map. I can setup a LocationListener
and assume that when onLocationChanged
is called that the blue dot is showing on the map but I don't need location updates in my app so implementing a LocationListener
seems like overkill. I couldn't find any interfaces to implement in the documentation for a callback such as this. Does anyone know of any other approaches I can use?
Upvotes: 0
Views: 666
Reputation: 10338
Seems like most of the location methods are depreciated for android. The one under development is the Location client. And from the documentation
This interface is deprecated. use LocationClient instead. LocationClient provides improved location finding and power usage and is used by the "My Location" blue dot. See the MyLocationDemoActivity in the sample applications folder for example example code, or the Location Developer Guide.
And as for the interface LocationClient.requestLocationUpdates() seems to be the way to go.
Upvotes: 1
Reputation: 55360
You can add a listener to location change directly on the GoogleMap
object. Then remove it after the first callback if you're not interested in further updates.
Check setOnMyLocationChangeListener()
.
It's deprecated, but it works (or at least it did work - I haven't used it recently).
Upvotes: 1