每个gps请求似乎都试图找到新的卫星。如何覆盖这个?

时间:2013-12-04 14:09:36

标签: android gps

我的应用程序每10秒就会获得当前的GPS坐标。 但我注意到每10秒GPS图标隐藏然后再次显示自己(我认为GPS会在每次请求时尝试找到新的卫星。)

如何向一颗卫星发出所有请求?

我的代码:

 if (isGPSEnabled) {
               // if (location == null) {
                    locationManager.requestLocationUpdates(
                            LocationManager.GPS_PROVIDER,
                            MIN_TIME_BW_UPDATES,
                            MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
                    Log.d("myLogs", "GPS Enabled");
                    if (locationManager != null) {
                        location = locationManager
                                .getLastKnownLocation(LocationManager.GPS_PROVIDER);
                        if (location != null) {
                            latitude = location.getLatitude();
                            longitude = location.getLongitude();
                        }
                    }
                }

0 个答案:

没有答案