How to reference 2 ArrayAdapters separately
<p>I've been working on understanding ArrayAdapters for the past 2 days, but can't seem to get them down entirely.</p>

<p>The following code is functional as is.</p>

<pre><code>    private void initAdapter(ArrayList&lt;String&gt; aL) {


    for (String s : aL) {
        aL.add(s);
    }

    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, aL) {
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
        View row;

        if (null == convertView) {
        row = mInflater.inflate(R.layout.list_item, null);
        } else {
        row = convertView;
        }

        TextView tv = (TextView) row.findViewById(android.R.id.text1);
        tv.setText(getItem(position));

        return row;
        }
       });
}
</code></pre>

<p>I am trying to make it into a method where I can use ArrayAdapter on multiple Arrays and put them into separate ListViews.
When I try modifying the method to </p>

<pre><code>private void initAdapter(ArrayList&lt;String&gt; aL, ListView L) {
</code></pre>

<p>and</p>

<pre><code>L.setAdapter(new ArrayAdapter&lt;String&gt;(this. R.layout.list_item, aL) {
</code></pre>

<p>I get an error at compile.
Also, why is it that you don't have to specify a ListView for your first ArrayAdapter. Does it just automatically reference anything with the id 'list'?</p>

<p>I am quite confused and stuck on this and would be very grateful for a well-explained answer.</p>
