Android Google MAP V2 MAP.setMyLocationEnabled(真)

Android Google MAP V2 MAP.setMyLocationEnabled(真),android,Android,我正在尝试使用MAP.setMyLocationEnabled(true)在Google地图中显示我的当前位置当我运行应用程序时,它将在前1-2分钟内始终显示错误位置。。。然后它将转到我当前的位置。每次打开应用程序时都会发生这种情况。我希望谷歌地图在我启动应用程序时显示我的当前位置 map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

我正在尝试使用
MAP.setMyLocationEnabled(true)
在Google地图中显示我的当前位置
当我运行应用程序时,它将在前1-2分钟内始终显示错误位置。。。然后它将转到我当前的位置。
每次打开应用程序时都会发生这种情况。我希望谷歌地图在我启动应用程序时显示我的当前位置

map =  ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();      
        map.setMyLocationEnabled(true);

您可以在应用程序位于前台时为其应用位置更新,并在后台禁用它们。在活动
onStart
onPause
中切换更新,使用:

要请求API更新,请执行以下操作:

LocationManager.requestLocationUpdates
LocationManager.removeUpdates
要删除API更新,请执行以下操作:

LocationManager.requestLocationUpdates
LocationManager.removeUpdates

发布您已实现的代码。感谢您的重播。我使用的是地图视图而不是位置管理器。那么我将如何/在何处使用它。您可以将更新放在主活动代码上,在启动时请求位置更新,在暂停时删除更新