摘要:
new AlertDialog.Builder(getApplicationContext())时发生错误:E/AndroidRuntime(5844): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application于是查了查:getApplicationContext() 生命周期是整个应用,应用摧毁它才摧毁 Activity.this的context属于activity ,activity 摧毁他就摧毁activity.this要返回一个a 阅读全文