android - How to conditionally show some components in a custom Dialog? -


i need create custom dialog, i'm doing follows:

    private void showsetoptions(activity context, useroptions useroptions)     {         var dialog = new dialog(context);         dialog.setcontentview(resource.layout.view_set_unset_buttons);     } 

the layout

view_set_unset_buttons 

is list of buttons user can press.

the trouble is, depending on the value of useroptions, don't want show buttons in view_set_unset_buttons.

is there way me apply logic creation of view_set_unset_buttons can hide of buttons?

solution:

the solution implement own dialog box, outlined in answer: how create custom dialog box in android?

you should implement own dialog custom layout, define layout programmatically before showing dialog. best practice. cheers.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -