android.view.WindowManager$BadTokenException: Unable to add window
2014-05-24 07:27
435 查看
前提:AlerDialog.builder嵌套使用出现android.view.windowmanager$badToken.....
异常出现的原因:
new AlertDialog.Builder(Context context)。该context不能使用this或者this.getParent。因为嵌套的层次过的,系统不知道在哪个view或者Activity上面创建该Dialog了,而必须使用***Activity.this。即:解决办法
new AlertDialog.Builder(**Activity.this);//你当前的Activity的名称
异常出现的原因:
new AlertDialog.Builder(Context context)。该context不能使用this或者this.getParent。因为嵌套的层次过的,系统不知道在哪个view或者Activity上面创建该Dialog了,而必须使用***Activity.this。即:解决办法
new AlertDialog.Builder(**Activity.this);//你当前的Activity的名称
相关文章推荐
- Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not
- android.view.WindowManager$BadTokenException: Unable to add window
- android.view.WindowManager$BadTokenException: Unable to add window 异常的处理
- android.view.WindowManager$BadTokenException: Unable to add window
- 关于android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an app
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- android.view.WindowManager$BadTokenException: Unable to add window — token null
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window
- 异常 android.view.WindowManager$BadTokenException: Unable to add window — token null
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
- android spinner点击android.view.WindowManager$BadTokenException: Unable to add window token is not va
- android.view.WindowManager$BadTokenException: Unable to add window -- token
- AlertDialog.Builder发生:android.view.WindowManager$BadTokenException: Unable to add window
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an applic
- android.view.WindowManager$BadTokenException: Unable to add window
- android.view.WindowManager$BadTokenException: Unable to add window
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli