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.
我有一项活动,其中包括:
android:theme="@android:style/Theme.Dialog"
当我启动它时,它看起来像一个活动,但是当我关闭它时,它会在启动它的活动上触发 onResume。真正的对话不会这样做。如何避免 onResume?
你不能——这是一项活动。您可以使用 onPause 等向调用活动添加一些状态机,但这可能会变得混乱。
您应该改用对话框。使用方法
setContentView(View view)
为了“填充”它