android get location from best provider available
问题 I have this code to get the best available provider lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationListener = new MyLocationListener(); Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); String provider = lm.getBestProvider(criteria, true); Location mostRecentLocation = lm.getLastKnownLocation(provider); if(mostRecentLocation != null) { latid=mostRecentLocation.getLatitude(); longid=mostRecentLocation.getLongitude(); } lm