4

I want to build a custom alert dialog with a checkbox at the title field of the AlertDialog as shown below.

enter image description here

What i have already have is this(check box is not visible, sorry for that):

enter image description here

How to get the check box here at the title field.? Also on selecting "All" options, all the other options should be selected.?

1
  • 3
    My suggestion is to create a fully customable dialog, for example in your dialog only the content is custom, but you can create a full custom dialog, here is the offical ducumentation. So you have to create the dialog with custom title and custom content. I hope it helps! Commented Dec 1, 2012 at 9:33

1 Answer 1

3

As kameny suggested you can go with custom dialog. You have to design a layout for that dialog as below

Textview Checkbox
Listview

You can remove the dialog title using dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

Add listener to the checkbox and check whether the checkbox is selected or not. If it is selected please put a loop for items in the listview and change the checkbox status of each item in the listview. After that refresh the listview using notifydatasetchanged()

Sign up to request clarification or add additional context in comments.

3 Comments

Can u suggest from posts which i can refer to populate checkbox thru listview.?
You can refer following link (dj-android.blogspot.in/2012/04/…)
thank you. i ahve also stuck with another problem. can u help on it. here is my another question.? :::stackoverflow.com/questions/13645911/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.