开发者

Is there a way to onCreateOptionsMenus() continue "listening" while a Progress Dialog is showing?

The Title is almost the entire question but i'll complement it with some things :

-(1) I have a AsyncTask for get some data from Internet -(2) I have a AsyncTask for display a Progre开发者_高级运维ss Dialog

Before call (1) , I execute (2) dialog.show() and when task (2) ends I call dialog.dimiss(). All is doing right , but while the Progress Bar is showing the Menu Button stay unresponsiveness, ie , nothing happens...

I would like to know if it is the default behavior or i missing something ?

I'm looking for it and did found anything that clear me about it..

Aprecciate any advice


You mean to say that while the dialog is showing, pressing the hard menu button does not bring up the menu. Did I get it right?

If so, then I see the same behavior as you. But according to this:

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.

So I would expect that the menu button should still work even if the dialog is showing, but based on my experience, it does not.

After the dialog is dismissed, the menu button should work again.


onCreateOptionsMenu is meant to prepare the dialog. Once it is shown and in use it is no longer being prepared and thus use of the dialog is then handled in onOptionsItemSelected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜