我java.io.IOException
在编译时遇到了未处理的异常。我在下面发布了代码,并指出了错误行。我搜索了很多有关此问题的帖子,但没有任何相关的解决方案。
MainActivity.java:
public class MainActivity extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
...................
}
public void startRecording() throws IOException {
..................
}
player.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
if (RecordFile != null && ifexist.equals("true")) {
}
else {
if (isRecclicked == true) {
recordButtonPressed = true;
try {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// this code will be executed after 2 seconds
startRecording(); ----> Unhandled Exception java.io.iOException
}
}, 2000);
}
catch (IOException e) {
e.printStackTrace();
}
}
}
}
try {
startRecording();
}catch(IOException ex) {
//Do something with the exception
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句