I am trying to search for best provider with this case below:
// GPS
case R.id.main_menu_gps:
// Set up location services
mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
mBestProvider = mLocationManager.getBestProvider(new Criteria(), true);
Log.d(DEB_TAG, "@@@@Value of mBestProvider is " + mBestProvider);
if(mBestProvider != null){
showGpsSearchingDialog();
mLocationManager.requestLocationUpdates(mBestProvider, 150000, 1, this);
} else {
Log.d(DEB_TAG, "Provider is null");
showGpsAlertDialog();
}
break;
My device is returning "GPS" as the best provider but is not able to find a location and my progress dialogue is displayed forever searching. If I go into the phone settings of "Location/Security" and check the "Use wireless networks" the best provider is Network and it works to return a location.
Am I doing something wrong when the best provider is GPS and no data is returned?