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

OnPause make sure to clean up the dialog #4

Open
benzabill opened this issue Jan 17, 2017 · 0 comments
Open

OnPause make sure to clean up the dialog #4

benzabill opened this issue Jan 17, 2017 · 0 comments

Comments

@benzabill
Copy link

If i am running flip progress dialog, and pause the activity that it runs in, and then return back to it, app will crash with the following error (and stack trace doesn't point to anything within app).

java.lang.RuntimeException: Unable to resume activity: java.lang.NullPointerException: Attempt to invoke

 virtual method 'android.view.Window android.app.Dialog.getWindow()' on a null object reference

   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3429)

My solution:

@Override protected void onPause() {

    super.onPause();

    if(flipProgressButton!= null){

        flipProgressButton.dismiss();

    }

}

I don't know how you want to address this, but perhaps you should have a try{}catch{} in your code, or in readme tell that you need to dismiss

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

1 participant