打开选项菜单与对话框打开 [英] Opening Options Menu with Dialog Open

查看:114
本文介绍了打开选项菜单与对话框打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个pretty简单的问题,但我不知道,如果它甚至有可能。是否有可能让MENU按钮,仍调出选项菜单时,一个对话框显示在上面?我想这样做,是因为我想给用户有更多选项可以打开一个对话框,而

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.

推荐答案

我不认为这是可能的。

I don't think that is possible.

虽然文档说,你应该能够做到这一点。

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

总是会创建一个对话框,并作为活动的一部分显示。你应该通常从活动的onCreateDialog(int)的回调方法中创建的对话框。当您使用此回调,Android系统的自动管理每个对话框的状态和他们挂钩的活动,这实际上使得每个对话框的所有者。这样,每个对话框继承从活动某些性能。例如,当一个对话框打开时,菜单键显示为活动定义的选项菜单和音量键修改由活动中使用的音频数据流。

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

这篇关于打开选项菜单与对话框打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆