I\'m trying to get the GPS coordinates to display when I click a button in my activity layout. The following is the method that gets called when I click the button:
The last part of the error message you quoted states:
...with ("checkPermission") or explicitly handle a potential "SecurityException"
A much quicker/simpler way of checking if you have permissions is to surround your code with try { ... } catch (SecurityException e) { [insert error handling code here] }. If you have permissions, the 'try' part will execute, if you don't, the 'catch' part will.