error: package PermissionUtils does not exist

后端 未结 2 733
南笙
南笙 2021-01-23 17:55

I want to find the current location of the user through my app and I copied the source code from Github and I don\'t know it does not give me any error but this one. Here\'s my

相关标签:
2条回答
  • You can use ActivityCompat instead:

    ActivityCompat.requestPermission(this, LOCATION_PERMISSION_REQUEST_CODE,
                    Manifest.permission.ACCESS_FINE_LOCATION, true);
    
    0 讨论(0)
  • 2021-01-23 18:37

    This is because your sample code is part of a tutorial and is still missing a helper class.

    Here is the PermissionUtils code located in GitHub in the same project.

    0 讨论(0)
提交回复
热议问题