Use itemclicklistener on your list.
If you are passing string to the arrayadapter as you mention in your code then it will be.
mListView.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
// TODO Auto-generated method stub
String item=arg0.getItemAtPosition(arg2).toString();
}
});
if you are passing array list in arrayadapter like
adapter = new ArrayAdapter<String>(this, R.layout.list_item, R.id.product_name, products);
then you can get the item at that particular position like following:
mListView.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
// TODO Auto-generated method stub
String item=arg0.getItemAtPosition(arg2).toString();
}
});