onItemClickListener 有以下参数 onItemClick(AdapterView arg0, View arg1,int arg2, long arg3) 我从 arg2 得到正确的结果,即选择的项目数但是当我尝试从视图程序访问字符串值时崩溃
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);
}
}
当我评论 Statement String S... 时,代码不会崩溃