안드로이드 웹뷰 액티비티를 사용하고 정상적으로 종료하지 않았을때

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();
}


사용자 삽입 이미지



Posted by incree

2018/01/26 23:16 2018/01/26 23:16
,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/385

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

« Previous : 1 : ... 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 : 19 : ... 149 : Next »

Notices

Archives

Authors

  1. incree

Recent Trackbacks

Calendar

«   2019/02   »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28    

Site Stats

Total hits:
528350
Today:
136
Yesterday:
239