Skip to content

Instantly share code, notes, and snippets.

@sprejjs
Created July 26, 2017 12:20
Show Gist options
  • Save sprejjs/405f8d44802197537b5a929cf2dff6dc to your computer and use it in GitHub Desktop.
Save sprejjs/405f8d44802197537b5a929cf2dff6dc to your computer and use it in GitHub Desktop.
@NonNull
@Override
public View getView(int position, @Nullable View convertView,
@NonNull ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(getContext())
.inflate(R.layout.contact_item, parent, false);
}
Contact contact = contacts.get(position);
((TextView)convertView
.findViewById(R.id.name_text_view))
.setText(contact.getName());
((TextView)convertView
.findViewById(R.id.mobile_text_view))
.setText(contact.getMobile());
((TextView)convertView
.findViewById(R.id.landline_text_view))
.setText(contact.getLandline());
return convertView;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment