Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random NullPointerException #61

Open
dexpota opened this issue Mar 20, 2019 · 2 comments
Open

Random NullPointerException #61

dexpota opened this issue Mar 20, 2019 · 2 comments

Comments

@dexpota
Copy link

dexpota commented Mar 20, 2019

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();
                }
            }
        });
    }
@abhijitca
Copy link

Please fix this Issue ASAP, My application became to buggy on this exception.

@Ratzz30
Copy link

Ratzz30 commented May 5, 2019

I have Encountered with same error MenuItem.setVisible is null Please the Fix Issue Asap. and I tried Manually to change MenuItem to ImageButton It Worked But I am unable to get the response OnActivityResult method. it would appreciated if you guys can fix this issue as soon as possible. Thanks In advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants