Skip to content

OnPause make sure to clean up the dialogΒ #4

@benzabill

Description

@benzabill

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions