gps检察可用与否

gps检查可用与否public boolean isGpsEnabled(Context context) {?? ? LocationManager locationManager

gps检查可用与否

public boolean isGpsEnabled(Context context) {?
? ? LocationManager locationManager = ((LocationManager)context.getSystemService(Context.LOCATION_SERVICE));?
? ? List<String> accessibleProviders = locationManager.getProviders(true);?
? ? return accessibleProviders != null && accessibleProviders.size() > 0;?
}?