简体   繁体   中英

QuickContactBadge showing contact's image

I'm trying to add a QuickContactBadge to a listview, it works fine and is clickable but currently shows no image, i'm sure there is a way to get it to display the contact's image but I'm not sure how. Can anyone help?

My code is:

    <QuickContactBadge android:id="@+id/contact"
    android:layout_width="54dp" android:layout_height="54dp"></QuickContactBadge>

and

    QuickContactBadge badgeSmall = (QuickContactBadge)messageView.findViewById(R.id.contact);  
    badgeSmall.assignContactFromEmail(message1.geteMail(), true);  
    badgeSmall.setMode(ContactsContract.QuickContact.MODE_SMALL);

Checkout this tutorial . I think that what you need to make sure you do is that your cursor has the PHOTO_ID column included.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM