listview中最后一个item是固定的,可以添加更多的item

@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		ViewHolder holder = null;
		if (convertView == null) {
			convertView = LayoutInflater.from(context)
					.inflate(R.layout.item_groupperson, null);
			holder = new ViewHolder();
			holder.icon = (ImageView) convertView
					.findViewById(R.id.iv_groupperson_icon);
			holder.name = (TextView) convertView
					.findViewById(R.id.tv_groupperson_name);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		//这里是关键
		 if(position
mMiddleGv.setOnItemClickListener(new OnItemClickListener() {
   @Override    public void onItemClick(AdapterView parent, View view, int position, long id) {
    android.widget.Adapter adapter = parent.getAdapter();     DisMembInfo item = (DisMembInfo) adapter.getItem(position);// 拿到当前数据值并强转                    // adpter.getItem(i)即为当前数据对象     if (!urls.contains(item)) {      urls.add(item);     }     GroupRightAdapter rightAdapter = new GroupRightAdapter(GroupPlaySelectActivity.this, mNumber, urls);     mRightListView.setAdapter(rightAdapter);    }   });

你可能感兴趣的:(listview中最后一个item是固定的,可以添加更多的item)