开发者

Android MapView Initial Location

开发者 https://www.devze.com 2023-03-16 14:42 出处:网络
My app currently starts detecting its location as soon as it launches however when I load up a MapActivity some time later it takes a while before MyLocationOverlay.runOnFirstFix is fired.

My app currently starts detecting its location as soon as it launches however when I load up a MapActivity some time later it takes a while before MyLocationOverlay.runOnFirstFix is fired.

Am I able to somehow pass the location I already have to the map when it is开发者_如何学Python initially created?


I find it hard to believe that your runOnFirst fix is taking a long time to run as if you already have an active location listener or had one recently it should get a location pretty quickly:

runOnFirstFix:

Queues a runnable to be executed as soon as we have a location fix. If we already have a fix, we'll execute the runnable immediately and return true. If not, we'll hang on to the runnable and return false; as soon as we get a location fix, we'll run it in in a new thread.

0

精彩评论

暂无评论...
验证码 换一张
取 消