fabric log
Crash Insights
Heads Up!
Unable to add window -- token is not valid; is your activity running?
Details:
This crash is usually caused by your app trying to display a dialog using a previously-finished Activity as a context. For 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.
s crash is usually caused by your app trying to display a dialog using a previously-finished Activity as a context. For 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.
Resources:
1. Android – Displaying Dialogs From Background Threads
2. Error : BinderProxy@45d459c0 is not valid; is your activity running?
Fatal Exception: android.view.WindowManager$BadTokenException
Unable to add window -- token android.os.BinderProxy@d21dce2 is not valid; is your activity running?
Raw Text
android.view.ViewRootImpl.setView (ViewRootImpl.java:890)
com.android.webview.chromium.Ap.handleJsAlert (WebViewContentsClientAdapter.java:355)
org.chromium.android_webview.AwContentsClientBridge$$Lambda$2.run (Unknown Source:3)
android.os.Handler.handleCallback (Handler.java:751)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1358)
Show all 44 Threads
이와 같은 에러가 나면서 앱이 크래쉬 되는 경우가 있다.
webview activity를 종료한 후 결제등의 화면에서 세션이 종료되는 것을 알리는 alert를 띄워줄때 발생하는 경우가 있다.
activity만 종료했기 때문이고, webview도 distory 해주면 이 에러는 해결된다.
백버튼이나 액티비티 종료 버튼을 눌러서 종료할때
다음과 같이 webview를 distory 한후 activity를 finish 한다.
@Override
public void onBackPressed() {
webView.destroy();
finish();
}
