您好,登錄后才能下訂單哦!
當Activity已經Finish了,還彈對話框的話,就會報這個錯
· 1Caused by: android.view.WindowManager$BadTokenException:Unable to add window -- token android.os.BinderProxy@42b22048 is not valid; isyour activity running?
· 2 atandroid.view.ViewRootImpl.setView(ViewRootImpl.java:541)
· 3 atandroid.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:259)
· 4 atandroid.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
· 5 at android.app.Dialog.show(Dialog.java:286)
· 6 atcom.mama100.android.member.wxapi.WXPayHelper.showWXPayFailedDialog(WXPayHelper.java:88)
· 7 atcom.mama100.android.member.activities.mothershop.SubmitOrderActivity$3.onCheckStatusResponse(SubmitOrderActivity.java:941)
· 8 atcom.mama100.android.member.wxapi.CheckWXPayStatus$TaskCheckWXPayStatus.handleResponse(CheckWXPayStatus.java:55)
· 9 atcom.mama100.android.member.activities.AsyncReqTask.onPostExecute(AsyncReqTask.java:50)
· 10 at com.mama100.android.member.activities.AsyncReqTask.onPostExecute(AsyncReqTask.java:1)
解決辦法 :
在dialog初始化前先加判斷
if (mContext.isFinishing()) {
return;
}
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。