title: How do I make an OptionDialog with checkboxes/Switches (Android Appcelerator)
body: <p>I want to create an OptionDialog like this on Android (each row having a label on the left and a Switch on the right):</p>
  
  <p><a href="https://i.stack.imgur.com/hc7OC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hc7OC.png" alt="example optiondialog"></a></p>
  
  <p>But the code I am using is not working:</p>
  
  <pre><code>var optsView = Ti.UI.createView({
      backgroundColor : '#ffffff',
  });
  
  var opts = ["aaa", "bbb", "ccc"];
  for (var i = 0; i &lt; opts.length; i++)
  {
      var row = Ti.UI.createView({
          backgroundColor: "#ffffff"
      });
  
      var label = Ti.UI.createLabel({
          left: "8dp",
          color: 'black',
          size: '14sp',
          title: opts[i]
      });
  
      var check = Ti.UI.createSwitch({
          style : Ti.UI.Android.SWITCH_STYLE_CHECKBOX,
          value : false,
          right: "8dp"
      }); 
  
      row.add(label);
      row.add(check);
  
      optsView.add(row);
  }
  
  var option = Ti.UI.createOptionDialog({
      title: 'Configuration',
      androidView: optsView
  });
  
  option.show();
  </code></pre>
  
  <p>The app will crash and show this on the console:</p>
  
  <pre><code>[ERROR] :  TiExceptionHandler: (main) [6049,7004] ----- Titanium Javascript Runtime Error -----
  [ERROR] :  TiExceptionHandler: (main) [0,7004] - In undefined:124,16
  [ERROR] :  TiExceptionHandler: (main) [0,7004] - Message: Uncaught java.lang.String cannot be cast to java.util.HashMap
  [ERROR] :  TiExceptionHandler: (main) [0,7004] - Source:         option.show();
  </code></pre>
  
  <p>I guess my problem is on the for loop. I tried commenting that piece of code and my app will not crash, but I do not know what is going wrong.</p>