Skip to content

Instantly share code, notes, and snippets.

@abhishekmukherg
Created June 4, 2013 04:17
Show Gist options
  • Save abhishekmukherg/5703537 to your computer and use it in GitHub Desktop.
Save abhishekmukherg/5703537 to your computer and use it in GitHub Desktop.
public class ABC
{
private static class ViewHolder
{
public TextView t1;
public Button b2;
}
public View getView(int position, View convertView, ViewGroup parent)
{
ViewHolder vh;
if (convertView == null)
{
convertView = mInflater.inflate(R.layout.magic_text_view, parent, false);
vh = new ViewHolder();
convertView.setTag(vh);
vh.t1 = convertView.findViewById(R.id.t1);
vh.b2 = convertView.findViewById(R.id.b2);
}
else
{
vh = (ViewHolder) convertView.getTag()
}
vh.t1.setText("foo");
vh.b2.setText("Bar" + position);
vh.b2.setBackground(R.drawable.asdf);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment