Android. How to know if location detected is from GPS or Network provider
问题 I'm trying to implement an application which senses position from both GPS and the network provider and shows it on a Google Map. I succeeded in doing this, but I have a question: I get the provider in the onCreate() of my Activity (it extends LocationListener) locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); provider = locationManager.getBestProvider(criteria, false); location = locationManager.getLastKnownLocation(provider);