Unable to add window … is your activity running?

Fatal Exception: android.view.WindowManager$BadTokenException
Unable to add window — token android.os.BinderProxy@795db42 is not valid; is your activity running?
android.view.ViewRootImpl.setView (
android.view.WindowManagerGlobal.addView (
android.view.WindowManagerImpl.addView ( ( ($800 ($H.handleMessage (
android.os.Handler.dispatchMessage (
android.os.Looper.loop ( (
java.lang.reflect.Method.invoke (
java.lang.reflect.Method.invoke ($ ( (


Fabric 사이트의 Crashlytics에 올라오는 지긋지긋한 오류 보고이다.
대처를 해도 계속 나온다.
뭔가 구멍이 있다.


가이드라인까지 알려줘서 처리했으나 계속 발생 중이다.

Crash Insights

Heads Up!
Unable to add window — token is not valid; is your activity running?

This crash is usually caused by your app trying to display a dialog using a previously-finished Activity as a contextFor example, this can happen if an Activity triggers an AsyncTask that tries to display a dialog when it is finished, but the user navigates back from the Activity before the task is completed.
External resources:

  1. Android – Displaying Dialogs From Background Threads
  2. Error : BinderProxy@45d459c0 is not valid; is your activity running?

액티비티가 종료중인지 여부를 체크하는 로직을 구현하였으나 효과는 없다.

if (! MainActivity.this.isFinishing()) {

마지막으로 Handler 메소드를 사용해보아야겠다.


Leave a Reply

error: Content is protected !!