I basically have a list of contacts in my app, I want to mark certain contacts on the list with the logo of my app if they are registered on my database. I have sorted out the server integration, but not sure how to add my logo to the contact list.
Examples of apps that have done something similar: Viber and Rebtel.
EDIT: the cycle of it is as such:
My getView is:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
view = mInflater.inflate(R.layout.screen_contact_item, null);}
final Contact contact = (Contact)getItem(position);
if(contact != null){
final TextView DisplayName = (TextView)
view.findViewById(R.id.screen_contacts_item_textView);
DisplayName.setText(contact.getDisplayName());}
I solved it by:
for (Contact contact : list) {
List<PhoneNumber> ListAllNumbers = contact.getPhoneNumbers();
for (PhoneNumber aNum : ListAllNumbers) {
for (String anAppNum : compareServer) {
if (aNum.getNumber().contentEquals(anAppNum)) {
contact.setAppContact(true);
Log.i(TAG, contact.getDisplayName() + " is registered");
}
Then in the getView, I added an if statement to set a drawable to the contact if it is an AppContact, or set drawable to hidden if they are not.