using an Array to query an sqlite database android
<p>how can i use an Array of strings to query an sqlite database? i keep getting the exception "SQliteException: bind or column index out of range". </p>

<pre><code>      String[] names = new String[values.size()]; // values is an Arraylist
      String[] condition = values.toArray(names);
Cursor row = db.query(true,DATABASE_TABLE, resultColumns, NAME +"=" + "?", condition, null, null, null,null);
</code></pre>

<p>please any help will be greatly appreciated as usual. Thanks</p>

<p>P.S values, which is the Arraylist is being poplulated through a loop so i can't have a defined size. thats why i can't use the get() method and seperate the elements in it by commas' which would have been easier. </p>
