标签:bar eth 作者 art span error ack mod isp
本文转载自:http://blog.csdn.net/ouyang_peng/article/details/48048975
今天在调用MediaRecorder.stop(),报错了,java.lang.RuntimeException: stop failed.
报错代码如下:
stop()方法源代码如下:
源代码中说了:Note that a RuntimeException is intentionally thrown to the application, if no valid audio/video data has been received when stop() is called. This happens if stop() is called immediately after start().The failure lets the application take action accordingly to clean up the output file (delete the output file, for instance), since the output file is not properly constructed when this happens.
现在,在mediarecorder.stop();这一句报错了,现在在mediarecorder.stop();这句之前加几句就不会报错了
mediarecorder.setOnErrorListener(null);
mediarecorder.setOnInfoListener(null);
mediarecorder.setPreviewDisplay(null);
改后代码如下:
作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!
转载请保留原文地址:http://blog.csdn.net/ouyang_peng
我的Android进阶之旅------>Android中MediaRecorder.stop()报错 java.lang.RuntimeException: stop failed.【转】
标签:bar eth 作者 art span error ack mod isp
原文地址:http://www.cnblogs.com/zzb-Dream-90Time/p/7736386.html