i am using following code to display list of tags now when i select any item a tick mark is displayed before that selected item.
and i move to next activity. now problem is when i come to this activity again using back button and scroll on that listview tick marks are displayed before many tags instead of single one i selected.
any one guide me what mistake am i doing here?
ImageView selectedTickImageView;
getview{
if (convertView == null) {
convertView = mInflater.inflate(R.layout.row_tags_archives, null);
holder = new ViewHolder();
holder.tickImageView= (ImageView)convertView.findViewById(R.id.tick_image_view);
holder.titletextView = ( TextView )convertView.findViewById(R.id.tv_tags_archives);
holder.tickImageView.setTag(position);
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View paramView) {
if(selectedTickImageView != null){
selectedTickImageView.setVisibility(View.GONE);
}
ImageView tickImageView = (ImageView)paramView.findViewWithTag(position);
tickImageView.setVisibility(View.VISIBLE);
selectedTickImageView =tickImageView;
S=tags[position];
S=S.replace(" ", "-");
S=S.toLowerCase();
Intent intent = new Intent(HPressTagsorUpdatesActivity.this ,HPressSummariesActivity.class);
startActivity(intent);
}});
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…