Android Marshmallow Location Permission handling

前端 未结 2 864
夕颜
夕颜 2021-01-16 03:05

I am working on Android Marshmallow runtime permissions. I asked user for location permission, suppose he has allowed to get the location and i have started getting location

2条回答
  •  心在旅途
    2021-01-16 03:39

        if (Build.VERSION.SDK_INT >= 23) {
           if (ContextCompat.checkSelfPermission(MainActivity.this, permission) != PackageManager.PERMISSION_GRANTED) {
        //here req again for Permission
        }
    }
    

提交回复
热议问题