How to Display Two ArrayList values in Android ListView?
<pre><code>package com.in2em.hotel;

import java.util.ArrayList;

import android.annotation.SuppressLint;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log; 
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.CheckedTextView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

@SuppressLint("ParserError")
</code></pre>

<p>Activity to display two arraylist in listview</p>

<pre><code>  public class OrderActivity extends ListActivity {
    ArrayList&lt;String&gt; data,rate;
    OrderAdapter orderAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.order);
        Bundle extras = getIntent().getExtras(); 
        data = extras.getStringArrayList("list");
        rate = extras.getStringArrayList("rate");
        for(String str : data)  {
            Log.d("data", str);

        }
        for(String str1 : rate) {
            Log.d("data", str1);

        }
</code></pre>

<p>data and rate are two arraylist</p>

<pre><code>        String[] captionArray = (String[]) data.toArray(
                new String[data.size()]);
        String[] rateArray = (String[]) rate.toArray(
                new String[rate.size()]);
        R.layout.order_list,R.id.itemname, captionArray));
</code></pre>

<p>How to set the two array list in listview ? I can set only one arraylist ?</p>

<pre><code>     orderAdapter = new OrderAdapter(
                OrderActivity.this, R.layout.order_list,
                captionArray);
</code></pre>

<p>setting the list adapter</p>

<pre><code>        setListAdapter(orderAdapter);

        return ;
    }
</code></pre>

<p>Custum listAdapter</p>

<pre><code>         private class OrderAdapter extends BaseAdapter {
        String[] items;

        public OrderAdapter(Context context, int textViewResourceId,
                String[] items) {
            this.items = items;
        } 
</code></pre>

<p>Returning the views</p>

<pre><code>        public View getView(final int POSITION, View convertView,
                ViewGroup parent) {

            TextView tvNumber,tvName,tvRate;
            EditText etQty,etRemarks;

            View view = convertView;
</code></pre>

<p>Inflate</p>

<pre><code>            if (view == null) {
                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                view = vi.inflate(R.layout.order_list, null);

            } 
                tvName = (TextView) findViewById(R.id.itemname);
            tvRate = (TextView) findViewById(R.id.itemrate);

            tvName.setText(data.get(POSITION));
            tvRate.setText(rate.get(POSITION));


            return view; 
        }


        public int getCount() {
            // TODO Auto-generated method stub
            return items.length;
        }


        public Object getItem(int position) {
            // TODO Auto-generated method stub
            return position;
        }


        public long getItemId(int position) {
            // TODO Auto-generated method stub
            return position;
        }
    }

}
</code></pre>
