Rumah > Soal Jawab > teks badan
ringa_lee2017-04-17 12:06:32
恩,你的理解是正确的,通过具体源码可以验证
//从Activity管理的容器中移除dialog的引用(可以近乎理解为销毁),并不显示对话框
public final void removeDialog(int id) {
if (mManagedDialogs != null) {
final ManagedDialog md = mManagedDialogs.get(id);
if (md != null) {
md.mDialog.dismiss();
mManagedDialogs.remove(id);
}
}
}
//仅仅是不显示对话框,便于再次使用。
public final void dismissDialog(int id) {
if (mManagedDialogs == null) {
throw missingDialog(id);
}
final ManagedDialog md = mManagedDialogs.get(id);
if (md == null) {
throw missingDialog(id);
}
md.mDialog.dismiss();
}