[Android] Activity has leaked window … that was originally added

  • 0
解決Activity has leaked window … that was originally added
Android錯誤排除_Activity ActivityName has leaked window com.android.internal.policy.impl.PhoneWindow DecorView@40d0ad20 that was originally added here



原因:有Dialog未關閉,但Activity就關閉了。
解決方法:在Activity結束時,呼叫dismiss()方法將其關閉。
@Override
protected void onDestroy() {
LoginProgressDialog.dismiss();
super.onDestroy();
}

沒有留言 :

張貼留言