Opening Options Menu with Dialog Open

2019-07-20 08:52发布

This seems like a pretty simple question, but I'm not sure if it's even possible. Is it possible to allow the MENU button to still bring up the option's menu when a dialog is showing on top? I want to do this because I want to give the user some more options while a dialog is opened.

1条回答
对你真心纯属浪费
2楼-- · 2019-07-20 09:40

I don't think that is possible.

Although the docs say that you should be able to do this.

A dialog is always created and displayed as a part of an Activity. You should normally create dialogs from within your Activity's onCreateDialog(int) callback method. When you use this callback, the Android system automatically manages the state of each dialog and hooks them to the Activity, effectively making it the "owner" of each dialog. As such, each dialog inherits certain properties from the Activity. For example, when a dialog is open, the Menu key reveals the options menu defined for the Activity and the volume keys modify the audio stream used by the Activity.

http://developer.android.com/guide/topics/ui/dialogs.html

查看更多
登录 后发表回答