H.fate H.fate - 1 year ago 178
Android Question

Android googlemap permission check, cannot resolve symbol

I got sample code from https://developers.google.com/maps/documentation/android-api/location?hl=en

if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
} else {
// Show rationale and request permission.

I uses above codes, but in Android Studio,
is described as
cannot resolve symbol ACCESS_FINE_LOCATION
with red color font. I already put
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
on my Androidmanifest

What should i do to solve this?

Answer Source

You can do import manifest manually.

Put import android.Manifest;import part of activity.java

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download