-
-
Notifications
You must be signed in to change notification settings - Fork 389
Open
Description
I am using AudioRecorderActivity and sometimes it crashes because the attribute saveMenuItem is null, the following is the exception launched:
2019-03-20 10:24:16.431 3586-3586/it.egate.intesi.eroi E/AndroidRuntime: FATAL EXCEPTION: main
Process: it.egate.intesi.eroi, PID: 3586
java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.MenuItem.setVisible(boolean)' on a null object reference
at cafe.adriel.androidaudiorecorder.AudioRecorderActivity.resumeRecording(AudioRecorderActivity.java:268)
at cafe.adriel.androidaudiorecorder.AudioRecorderActivity.access$200(AudioRecorderActivity.java:33)
at cafe.adriel.androidaudiorecorder.AudioRecorderActivity$1.run(AudioRecorderActivity.java:223)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
From what I can see the problem arise when the method is called from the callback defined intoggleRecording
public void toggleRecording(View v) {
stopPlaying();
Util.wait(100, new Runnable() {
@Override
public void run() {
if (isRecording) {
pauseRecording();
} else {
resumeRecording();
}
}
});
}
Moseqi and piappstudio
Metadata
Metadata
Assignees
Labels
No labels