我使用Media Recorder API创建了一个基本的录音应用程序.我正在尝试在SD卡中创建一个文件夹,并将我录制的文件保存到该文件夹中.我收到以下代码的警告.
File.mkdir()被忽略
// Assign random number to avoid audio file from overwriting
Long tsLong = System.currentTimeMillis()/1000;
// Specify a Location for the recorded file to be stored in the SD card
mFileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "/AudioRecordTest/";
File path = new File(mFileName);
if(!path.exists()) {
path.mkdir();
}
mFileName += "/AudioRecordTest_" + tsLong.toString() + ".mp3";
Run Code Online (Sandbox Code Playgroud)
如何解决此警告消息.如果有任何其他错误,请随意修改代码.