i have a problem of passing two values in different ArrayLists.
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?
lv = getListView();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, names);
setListAdapter(adapter);
lv.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> 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);
}
});
in second activity