SHARE
TWEET

Untitled

a guest Jan 28th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.  
  4.  
  5. MyActivity implements ActivityCompat {
  6.    
  7.  
  8.  
  9.     public onCreate() {
  10.  
  11.         if (iHavePermission) {
  12.             startLocation();
  13.         } else{
  14.  
  15.         }
  16.  
  17.  
  18.     }
  19.  
  20.     @Override
  21.     public onRequestPermissionResult(int code, string[] permissions, int result) {
  22.         if (permissions contains fine_location) {
  23.             if (result == DENIED) {
  24.                 // Show Error Message
  25.             } else {
  26.                 startLocation();
  27.             }
  28.         }
  29.        
  30.     }
  31.  
  32.     private startLocation() {
  33.         // Start location requests, blah balha blah
  34.  
  35.     }
  36.  
  37.  
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top