Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyActivity implements ActivityCompat {
- public onCreate() {
- if (iHavePermission) {
- startLocation();
- } else{
- }
- }
- @Override
- public onRequestPermissionResult(int code, string[] permissions, int result) {
- if (permissions contains fine_location) {
- if (result == DENIED) {
- // Show Error Message
- } else {
- startLocation();
- }
- }
- }
- private startLocation() {
- // Start location requests, blah balha blah
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement