Android checkable submenu options

前端 未结 1 1532
南旧
南旧 2020-12-19 14:27

So I have a submenu that I have for an options menu item. I want a list of checkable entries that the user can select/deselect as many as they want. The only problem I can\'

相关标签:
1条回答
  • 2020-12-19 14:56

    The way I would handle this is using the standard alert dialog class. In your menu handler, create an AlertDialog and pass an array of your options to the Builder.

    The method you should pay attention to is AlertDialog.Builder.setMultiChoiceItems(CharSequence[] items, boolean[] checkedItems, DialogInterface.OnMultiChoiceClickListener listener)

    Pass an array to this method and put your submenu selection code in the ClickListener.

    0 讨论(0)
提交回复
热议问题