Courses • Unity Assets • PlayStore • Hosting • Channel • بالعربي

Ahmad Naser Navigation
  • Home
    • Apps
    • Arabic Website
    • Our Academy
    • Udemy Courses
    • Certification
    • Youtube
    • Code Snippets
  • About
    • About Us
    • Services
    • Apps
    • Clients
    • Projects
    • Professional Training
  • Courses
  • My Account
  • Shop
    • Go Shopping
    • Online Coaching
    • One-To-One Training Pricing
    • Hosting
    • Cart
    • Checkout
  • Blog
  • Contact
  • 0 Items$0.00
  • Home
    • Apps
    • Arabic Website
    • Our Academy
    • Udemy Courses
    • Certification
    • Youtube
    • Code Snippets
  • About
    • About Us
    • Services
    • Apps
    • Clients
    • Projects
    • Professional Training
  • Courses
  • My Account
  • Shop
    • Go Shopping
    • Online Coaching
    • One-To-One Training Pricing
    • Hosting
    • Cart
    • Checkout
  • Blog
  • Contact
  • 0 Items$0.00
Home Gist Check permission in android with kotlin
back to snippest | Comment | Share

1
2
3
4
5
6
7
8
9
10
11
12
   var ACCESSLOCATIONREQUESTCODE=200
    private fun permissionCheck() {
        if (Build.VERSION.SDK_INT>=23){
            if (ActivityCompat.checkSelfPermission(this,android.Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED){
               requestPermissions(arrayOf(android.Manifest.permission.ACCESS_FINE_LOCATION),ACCESSLOCATIONREQUESTCODE)
                return
 
            }
        }
 
        GetCurrentLocation()
    }