Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果没有找到则返回 false 否则返回 true 不是更好的设计吗?现在我必须要么确保我正在关闭显示的对话框,要么用 try and catch 来围绕每个呼叫......任何人都可以告诉/猜测他们为什么认为这是一个好的设计?
似乎他们也将dismissDialog()作为最终原因我无法覆盖它可以吗?
谢谢!
我会使用作为替代方案removeDialog()而不抛出异常。
removeDialog()
此外,这两种方法在 API 级别 13 中均已弃用。
所以使用DialogFragment