android 异常分析

 异常1、 ERROR/AndroidRuntime(8666):android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@42208f98 is not valid; is your activity running? 

在使用activityGroup的时候(形如类似堆栈的时候),

在里面的Activity用AlertDialog对话框是,报异 常:“android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@983iefd89 is not valid; is your activity running? ”

把AlertDialog里面的context:xxxActivity.this 改为::“xxxActivity.this.getParent()”就搞定!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章