When adding permissions to my manifest file, the below xml works.
<permission android:name="android.permission.ACCESS_FINE_LOCATION" />
However, this xml doesn't work.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Which one am I supposed to be using? If it's the first one, why wouldn't it work? How can I fix it?
Also, I am getting an Android 6.0 runtime permissions related exception:
java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission.
When I try to add the permission to a String array in order to check the permission, Android Studio tells me it can't resolve Manifest.permission
in the below code:
new String[]{Manifest.permission.ACCESS_FINE_LOCATION}
Why would it be doing this? How can I fix it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…