Adding an additional item with setCheckable(true) doesn't work, since checking the checkbox also closes the dialog. Therefore the simplest way I came up with is to use an AlertDialog and add a CheckedTextView via alert.getListView().addFooterView(...); and overriding it's onItemSelected method.
Would be great though if a standard context menu would also offer this by default already. On Nov 4, 1:48 pm, Mathias Lin <m...@mathiaslin.com> wrote: > Is there a standard way to add a footer to a context menu, in which I > can add a checkbox to make the selected option the default one? Similar > to the context menu that comes up when choosing the default home screen > for example. > > http://i.imgur.com/B2wvC.png > > From the Api docs for ContextMenu I see that you can set a header view, > but not a footer view. Same for the AlertDialog, also only has a > setCustomTitle() method, but nothing for the footer. > > Does this need to be done via a custom (alert) dialog? I would be > wondering if nobody has yet developed such a component yet in case it's > not possible through the standard SDK api. Any standalone open source > component out there (beside the Android source code itself)? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en