Unable to resolve ACCESS_FINE_LOCATION symbol

I have this code

if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { 

In manifests, I have enabled this permission

 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 

But I got an error cannot resolve symbol 'ACCESS_FINE_LOCATION'

How to solve this problem?

+7
android manifest gps
source share
3 answers

This permission is in the android package

 android.Manifest.permission.ACCESS_FINE_LOCATION 
+8
source share

import android.Manifest; because sometimes it uses a class manifest

+5
source share

Put this permission in AndroidManife.xml before running the application tag.

  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
0
source share

All Articles