title: How to make ArrayAdapter populate 2 Arraylists within the same ListView
body: <p>I want to make 2 <code>ArrayList&lt;Strings&gt;</code>s of the same length, appear, like this, in 1 <code>ListView</code></p>
  
  <p>Word 1 is a <code>TextView</code> that should be populated with 1 <code>ArrayList&lt;String&gt;</code> and Word 2 is another <code>TextView</code> that should be populated with a different <code>ArrayList&lt;String&gt;</code></p>
  
  <p><strong>*These are</strong> <code>TextViews</code>, <strong>not</strong> <code>Button</code><strong>s</strong></p>
  
  <p><img src="https://i.stack.imgur.com/trHAJ.png" alt="Word 1 is an &lt;code&gt;ArrayList&lt;/code&gt;, Word 2 is another &lt;code&gt;ArrayList&lt;/code&gt;"></p>
  
  <p>What should my <code>ArrayAdaptor</code> look like?</p>
  
  <p>If this is a duplicate please send me a link.</p>
  
  <p><strong>CustomArrayAdapter.java that displays the same <code>ArrayList&lt;String&gt;</code> on both sides (Not what I need)</strong></p>
  
  <pre><code>public class CustomArrayAdapter extends BaseAdapter {
  Context context;
  private ArrayList&lt;String&gt; words1;
  private ArrayList&lt;String&gt; words2;
  
  public CustomArrayAdapter(Context context, ArrayList&lt;String&gt; words1, ArrayList&lt;String&gt; words2) {
      this.words1 = words1;
      this.generates = words2;
      this.context = context;
  }
  
  public View getView(int position, View convertView, ViewGroup parent) {
  
      View v = convertView;
  
      if (v == null) {
          LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          v = inflater.inflate(R.layout.list_item, null);
      }
  
      String a = (String) getItem(position);
      String b = (String) getItem(position);
  
      TextView tv1 = (TextView) v.findViewById(R.id.rhymed_word);
      TextView tv2 = (TextView) v.findViewById(R.id.generated_word);
  
      tv1.setText(a);
      tv2.setText(b);
  
      return v;
  
  }
  
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
      return words1.size();
  }
  
  @Override
  public Object getItem(int position) {
      if (position &gt;= words1.size())
          return words2.get(position);
      return words1.get(position);
  }
  
  @Override
  public long getItemId(int position) {
      // TODO Auto-generated method stub
      return position;
  }
  </code></pre>
  
  <p>}</p>