private void addTagToView(final Tag tag){
  if (!mTagViewMap.containsKey(tag)) {
    final TextView textView=getTextView();
    textView.setText(tag.name);
    mTagViewMap.put(tag,textView);
    if (mTagsAreClickable) {
      textView.setOnClickListener(this);
    }
 else {
      textView.setOnClickListener(null);
    }
    textView.setTag(tag);
    if (mSelectedTags.contains(tag.id)) {
      textView.setSelected(true);
    }
 else {
      textView.setSelected(false);
    }
    addView(textView);
  }
}

private void addTagToView ( final Tag tag ) { if ( ! mTagViewMap . containsKey ( tag ) ) { final TextView textView = getTextView ( ) ; textView . setText ( tag . name ) ; mTagViewMap . put ( tag , textView ) ; if ( mTagsAreClickable ) { textView . setOnClickListener ( this ) ; } else { textView . setOnClickListener ( null ) ; } textView . setTag ( tag ) ; if ( mSelectedTags . contains ( tag . id ) ) { textView . setSelected ( true ) ; } else { textView . setSelected ( false ) ; } addView ( textView ) ; } }
adds the tag to the view
