Skip to content

randroid.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running? #2

@mak12

Description

@mak12

when ever showProgress(); is called i am getting an exception and application is crashing , check for the reason and found it was this line causing the issue

  public void showProgress() {
       try {

           //here is the crash happening 
            windowManager.addView(progressLayout, layoutParams); 

    }
    catch (WindowManager.BadTokenException e){
        Log.d("ProgressWindow" ,"ReasonFor"+e.toString());
    }

}

any help?

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