Hi,

I wish to replace the default Menu with a Dialog that consists of
several TextViews. Creating the dialog is easy, however how does one
override the defualt Menu and have the dialoge "show" and dismiss" in
the same manner as the default menu?

Currently I create the dialog like this:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);

        dialog = new Dialog(this);
        dialog.setContentView(R.layout.menu_map_screen);

        dialog.show();

        return true;
}

This works and displays the dialog when the "Menu" button is pressed,
however if I press the "back" button to hide the dialog the dialog
fails to display again if I repress the "Menu" button.

I thought maybe the dialog needed to be properly "dismissed" so I
overrided this method:

@Override
public void onOptionsMenuClosed(Menu menu) {
        super.onOptionsMenuClosed(menu);
        dialog.dismiss();
}

However, this does not work either.

Anyone know the correct way to do this?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to