I have a problem with this code:
boolean gpsStatus = locmanager.isProviderEnabled(LocationManager.GPS_PROVIDER);
if (!gpsStatus) {
Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "network,gps");
}
I found it here: https://stackoverflow.com/a/10004614/2628458 I tried to switch "locmanager" with "LocationManager" and it has not worked. It says: "Cannot make a static reference to the non-static method isProviderEnabled(String) from the type LocationManager."
How can I fix this problem?