Hello, it became necessary to create a popup menu. I rummaged, there are no examples anywhere, only on off. site , but the problem is that this menu for the API is at least 11, and I need to run on 7. How can I do something like this?

3 answers 3

It seems that what you need is described here: Creating QuickAction dialogs in Android +)

  • Thanks, took this idea! - andreich

Simply use AlertDialog instead of PopupMenu. For the usual menu is enough options with a list. Read more here: Creating an AlertDialog .

  • The fact is that I need a menu like popup, so that when I press the button on the activation button, they will sort out their buttons - andreich
  • Then try to take the source code PopupMenu from the last slice of the code and add to your project, it is possible that major changes will not be required. - Hi
  • The fact is that for the link that I gave, you need API> = 11 - andreich
  • It's clear. Just rip out the source code from the latest version of the code, add it to your project, and then change it so that everything compiles and works. There are 200 lines - maybe not much and it will be necessary to redo it. PS But it is easier to take Dialog. - Hi
  • It seems to me that this is too much for the menu: D I was hoping that someone had already done this, because in many applications there is such a thing, I do not think that everyone used the method you suggested. - andreich

PopupMenu is essentially a regular Spinner . Well, then take the tie to a thread button, so that Spinner pops up, no?

  • Unfortunately, the spinner does not suit me, but thanks anyway. - andreich