public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { TextView text = (TextView) view.findViewById(R.id.Gi_item_name); Toast.makeText(this, text.getText(), Toast.LENGTH_SHORT).show(); }
直接用View来取值
Gi_item_name 是控件id
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { TextView text = (TextView) view.findViewById(R.id.Gi_item_name); Toast.makeText(this, text.getText(), Toast.LENGTH_SHORT).show(); }
直接用View来取值
Gi_item_name 是控件id
转载于:https://my.oschina.net/u/1386996/blog/993976