12

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 manifest, I have included this permission

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

But I got error cannot resolve symbol 'ACCESS_FINE_LOCATION'

How to solve this problem?

CherryBelle
  • 1,302
  • 7
  • 26
  • 46
  • Its resolved here too : http://stackoverflow.com/questions/34139048/cannot-resolve-manifest-permission-access-fine-location – Pablo Cegarra Aug 31 '16 at 05:29

4 Answers4

18

import android.Manifest; since sometimes it uses class manifest

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
Sanket Parchande
  • 894
  • 9
  • 14
10

This permission is in android package

android.Manifest.permission.ACCESS_FINE_LOCATION
Mykhailo Yuzheka
  • 713
  • 1
  • 7
  • 24
1

You should add the following code:

import android.Manifest;
0

Put this permission in AndroidManife.xml before application tag starts

 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Jhaman Das
  • 1,094
  • 13
  • 28