title: Dialog with multiple choices and custom view
body: <p>I'm struggling with this problem for a day now, and I just can't figure out how to solve it.</p>
  
  <p>So, I have an AlertDialog where I want to display a list of items to choose. These items must have multiple text views and so, so I cannot rely on a simple <code>setMultiChoiceItems()</code> on builder using default format.</p>
  
  <p>I use my custom ArrayAdapter here, by doing this:</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);
  builder.setTitle("Choose details to display");
  builder.setAdapter(new ContactAdapter(this, 0, items), null);
  </code></pre>
  
  <p>I thought I could use an <code>OnClickListener</code> as the second paramtere of <code>setAdapter</code> but that closes the dialog after choosing one option.</p>
  
  <p>Trying to fix this I added a <code>setOnClickListener()</code> inside my ContactsAdapter when I fetch the row layout, like this:</p>
  
  <pre><code>LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  view = inflater.inflate(R.layout.contact_row, null);
  view.setOnClickListener(new OnClickListener() {....}
  </code></pre>
  
  <p>This works, but I stop getting the highlight when I click a row, which I really don't want.</p>
  
  <p>Any ideas how to solve this? I know I could use a ListActivity and that would be easy to solve, but I really want to do this in a dialog. Thanks!</p>