이런식으로 어레이어뎁터를 만들었는데..
리스트뷰가 6개정도 보여지는데.. 이벤트는 각각 다 걸리는데
저 setTag(position) < 이부분만 마지막값 즉 5밖에 저장이 안되고 각각 저장은 안되네요..
각각 저장이 되게는 어떻게하나요?
public View getView(int position, View convertview, ViewGroup parent){
LayoutInflater li = (LayoutInflater)con.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertview=li.inflate(R.layout.cardlistview, null);
RelativeLayout rl = (RelativeLayout)convertview.findViewById(R.id.lists);
rl.setOnLongClickListener(this);
rl.setTag(position);
}
public boolean onLongClick(View v) {
int count = (int)rl.getTag();
Toast.makeText(getContext(), count+"", Toast.LENGTH_SHORT).show();
if((int)rl.getTag()==count){
Toast.makeText(getContext(), "드루와", Toast.LENGTH_SHORT).show();
}
return false;
}