我正在使用 android 列表片段,以下是我的适配器类
private class HugStatusAdapter extends ArrayAdapter<Status> {
………….
public View getView(int position, View convertView, ViewGroup parent) {
………..
//set tag to view(type Status is bean class)
convertView.setTag(getItem(position));
}
public void onListItemClick(ListView l, View v, int position, long id) {
Bundle mBundle = new Bundle();
// how to get the tag (Status) and put it into mBundle
}
}
我的问题是如何将 object(Status) 类型标签设置为视图并从 onListItemClick() 获取该标签?