Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@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