I am new to android development. I am just trying to record an audio with android studio(2.1.1) testing with 6.0.1 Marshmallow device.
public class MainActiv
I had the exact same problem and managed to fix it by asking for permission to record audio:
if (ActivityCompat.checkSelfPermission(activity(), Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(activity(), new String[]{Manifest.permission.RECORD_AUDIO}, BuildDev.RECORD_AUDIO);
} else {
startRecording();
}
where
BuildDev.RECORD_AUDIO is public static final int RECORD_AUDIO = 0;