막무가내 삽질 블로그
WindowManager: android.view.WindowLeaked 본문
안드로이드에서 다이얼로그를 만들 후 dismiss를 시키지 않고 Activity를 종료한 후
WindowManager를 이용하여 addView를 추가 시키고자 할때 에러 메시지
E/WindowManager( 1374): Activity com.jjoe64.example.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@405446f8 that was originally added here
E/WindowManager( 1374): android.view.WindowLeaked: Activity com.jjoe64.example.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@405446f8 that was originally added here
E/WindowManager( 1374): at android.view.ViewRoot.<init>(ViewRoot.java:258)
E/WindowManager( 1374): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
E/WindowManager( 1374): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
E/WindowManager( 1374): at android.view.Window$LocalWindowManager.addView(Window.java:424)
E/WindowManager( 1374): at android.app.Dialog.show(Dialog.java:241)
E/WindowManager( 1374): at com.jjoe64.example.MainActivity.showLoading(MainActivity.java:682)
E/WindowManager( 1374): at com.jjoe64.example.view.HieraticalHostListView.loadData(HieraticalHostListView.java:84)
E/WindowManager( 1374): at com.jjoe64.example.MainActivity.setupListViewStatus(MainActivity.java:479)
E/WindowManager( 1374): at com.jjoe64.example.MainActivity.checkZabbixLogin(MainActivity.java:162)
E/WindowManager( 1374): at com.jjoe64.example.MainActivity.onResume(MainActivity.java:279)
E/WindowManager( 1374): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
E/WindowManager( 1374): at android.app.Activity.performResume(Activity.java:3832)
E/WindowManager( 1374): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
E/WindowManager( 1374): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
E/WindowManager( 1374): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
E/WindowManager( 1374): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/WindowManager( 1374): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/WindowManager( 1374): at android.os.Handler.dispatchMessage(Handler.java:99)
E/WindowManager( 1374): at android.os.Looper.loop(Looper.java:123)
E/WindowManager( 1374): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/WindowManager( 1374): at java.lang.reflect.Method.invokeNative(Native Method)
E/WindowManager( 1374): at java.lang.reflect.Method.invoke(Method.java:507)
E/WindowManager( 1374): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/WindowManager( 1374): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/WindowManager( 1374): at dalvik.system.NativeStart.main(Native Method)
</init>
해결 방법
@Override
protected void onStop() {
super.onStop();
if (progressDialog != null) {
progressDialog.dismiss();
progressDialog = null;
}
}
'Android' 카테고리의 다른 글
안드로이드 뷰(View) 뷰그룹(ViewGrop) (0) | 2019.12.05 |
---|---|
안드로이드 MVP 디자인패턴 간단한 정리 (0) | 2019.12.01 |
error : Unable to add window -- token null is not valid; is your activity running (0) | 2019.09.19 |
error code : You need to use a Theme.AppCompat theme (or descendant) with this activity (0) | 2019.09.19 |
android github file upload, 안드로이드 코드 깃허브에 업로드 (0) | 2019.09.14 |