Call requires permission which may be rejected by user

Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with `checkPermission`) or explicitly handle a potential `SecurityException`

 
try {
// your code for example: 
//  LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);         
//  Criteria criteria = new Criteria();
//        provider = locationManager.getBestProvider(criteria, false);
//  locationManager.requestLocationUpdates(provider, 400, 1, this);
        } catch (SecurityException e) {
            e.printStackTrace();
        }
This entry was posted in Android Examples Code, Bugs, warnings, errors and tagged . Bookmark the permalink.


Comments are closed.

5,920 views