I need to utilize the microphone with Android M. I've tried setting up a permission group in the manifest, and can't get it working properly. Here's what I've got in the manifest:
<permission-group android:name="android.permission-group.MICROPHONE"
android:label="label"
android:icon="@mipmap/day_icon"
android:priority="360"/>
<permission android:name="android.permission.MICROPHONE"
android:permissionGroup="android.permission-group.MICROPHONE"
android:protectionLevel="dangerous"
android:label="label" />
I've also tried getting the access through code:
if (ContextCompat.checkSelfPermission(getActivity(),
Manifest.permission_group.MICROPHONE)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(getActivity(),
new String[]{Manifest.permission_group.MICROPHONE},
REQUEST_MICROPHONE);
}
The alert doesn't show to grant access.
I still don't have access to microphone. Anyone know how get permission for the microphone?
Note: This is only not working for Android M