什么是hide?
什么是dismiss
到底该如何选择?
个人理解:
Hide the dialog, but do not dismiss it.--官方文档
Dismiss this dialog, removing it from the screen.--官方文档
Start the dialog and display it on screen.--官方文档
如果Dialog使用不频繁的话,就dismiss()吧.
因为如果使用hide(),而忘记在finish()没有dismiss(),有可能会报错窗口泄露哦。
……
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
hide的意思是把view设置成不可见,但还是在根view的子节点上
dismiss的意思是直接把view从根view的子节点上移除,资源会全部释放掉
//hide
public void hide() {
// dismiss
void dismissDialog() {