Android ListView pass data to another listview
<p>How to write the code that can pass data from one lisview to another listview like if i select  BMW from the car brand list i will be able to choose a particular car series that in a listview</p>

<p><strong>main.XML</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:textSize="20sp" &gt;
&lt;/TextView&gt;
</code></pre>

<p><strong>CarActivity.JAVA</strong></p>

<pre><code>package car.brand.test;

package car.brand.test;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class CarActivity extends ListActivity {
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        String[] values = new String[] { "BMW", "Mercedes","Nissan"};
        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
                android.R.layout.simple_list_item_1, values);
        setListAdapter(adapter);
    }

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    String item = (String) getListAdapter().getItem(position);
    Toast.makeText(this, item + " selected", Toast.LENGTH_LONG).show();
}
</code></pre>

<p>}</p>
