onItemClickListener has following arguments onItemClick(AdapterView arg0, View arg1,int arg2, long arg3) I am getting correct result from arg2 i.e. number of item which is selected but when i try to access string value from view program is crashing
public void onItemClick(AdapterView<?> arg0, View arg1,int arg2, long arg3)
{
String s = ((TextView)arg1).getText().toString();
try
{
Log.v("----","ActionListener called"+arg2);
}
catch(Exception E)
{
Log.v("----","unable to get Text from Text field "+arg2);
}
}
when I comment Statement String S... code does not crash