当我进行调试时,它没有去 try 块而不是 catch 块,这是我的代码,请帮助我!
public void onClick(View v) {
try {
path = Environment.getExternalStorageDirectory()+"/audio_meena.AMR";
File newFile = new File(path);
Uri uri =Uri.fromFile(newFile);
Intent audioIntent=new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivityForResult(audioIntent, RQS_RECORDING);
mr.setAudioSource(MediaRecorder.AudioSource.MIC);
mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
FileDescriptor PATH_NAME = null;
mr.setOutputFile(PATH_NAME);
} catch (Exception e) {
// TODO: handle exception
}
}
});