title: Populating a MultiChoiceItem Dialog interface with ArrayList / CharSequence[] (dynamic data)
body: <p>I've been trying to implement an ArrayAdapter or ArrayList into a custom dialog through its builder, as I need the ability to multiselect, and at same time the list items are going to be dynamic(fetching from database). </p>
  
  <pre><code>alertDialogBuilder.setMultiChoiceItems(items, checkedItems, listener);
  </code></pre>
  
  <p>In my case I need the <code>items</code> to be populated by an <code>ArrayList&lt;String&gt;</code> or <code>ArrayList&lt;CharSequence&gt;</code> but i can't seem to get them working.</p>
  
  <p>The type of MultiChoice dialog i mentioned is similar to this <a href="http://chrisblunt.com/2011/03/01/android-spinner-like-ui-for-selecting-multiple-options/" rel="nofollow noreferrer">android-spinner-like-ui-for-selecting-multiple-options</a> </p>
  
  <p><img src="https://i.stack.imgur.com/D3Lap.jpg" alt="enter image description here"></p>
  
  <p>I've tried searching but the only solutions i get are for single choice items. The <code>builder.setAdapter(ListAdapter, OnClickListener)</code> method only allows an OnClickListener while i need a DialogInterface.OnMultiChoiceClickListener instead. Can anyone kindly enlighten me a little? Thanks!</p>