Created
December 16, 2011 20:50
-
-
Save rduplain/1487917 to your computer and use it in GitHub Desktop.
Android: view holder without a ViewHolder class, when only one view to hold.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public View getView(int position, View convertView, ViewGroup parent) { | |
if (convertView == null) { | |
convertView = activity.getLayoutInflater().inflate(layoutId, null); | |
convertView.setTag(convertView.findViewById(textViewId)); | |
} | |
TextView textView = (TextView) convertView.getTag(); | |
textView.setText(items.get(position).getTitle()); | |
return convertView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment