I receive crush, when user turn off the gps. I have code like this to detect location`s user
if(locationManager == null) {
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
}
if(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000L,
15f, mLocationListener);
} else if(locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)){
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000L,
15f, mLocationListener);
} else {
Toast.makeText(this, "Please turn on gps on ypur phone", Toast.LENGTH_SHORT).show();
}
When user open app with gps, then turn off it, I receive crush like this
java.lang.AbstractMethodError: abstract method "void android.location.LocationListener.onProviderDisabled(java.lang.String)"
I tried to detect when user turn off gps, but I get crush earlier, then receiver detect