passing values to nest activity from diff lists
<p>i have a problem of passing two values in different <code>ArrayList</code>s.</p>

<p>I made a listView and fetched to it list2 elements. when click on the listView item want to pass the selected item and the element in the list1 at the same position. The problem in next code that its pass only the selected item from listView?? how can i make it work to pass both values to next activity?</p>

<pre><code>lv = getListView();
ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
        android.R.layout.simple_list_item_1, names);
setListAdapter(adapter); 

lv.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(AdapterView&lt;?&gt; parent, View view,
    int position, long id)
    {
         //int c=parent.getSelectedItemPosition();
           String bb=parent.getItemAtPosition(position).toString();
           Intent i = new Intent(LastActivity.this, Details.class);
          String ur=links.get(position).toString();
           //  String x=edt.getText().toString();
            i.putExtra("name",bb);
            i.putExtra("link",ur);
            // starting new activity
            startActivity(i);

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