android - How to retrieve contact's thumbnail -
i'm coding activity show list of contact. list has 2 fields per entry: id column , display_name column of table identified uri contactscontract.contacts.content_uri. display result of query utilize simplecursoradapter.
now want add together new field each entry, thumbnail of contact. added query's projection column name photo_thumbnail_uri, no image inserted. if add together column name photo_uri image inserted big.
so, want utilize simplecursoradapter display contact's entry, each 1 have id of contact, display_name, , thumbnail.
second, if thumbnail missing want insert default thumbnail, illustration this.
can explain me how can it? can read topic? should standard task!
loading images in list view not standard task. requires implementation of lazy loading cache of photos.
you can check how android in people app here http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.3_r1/com/android/contacts/common/list/contactentrylistadapter.java#contactentrylistadapter.getphotoloader%28%29
they asynchronous photo loader photo cache http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.3_r1/com/android/contacts/common/contactphotomanager.java#contactphotomanagerimpl.loadthumbnail%28android.widget.imageview%2clong%2cboolean%2ccom.android.contacts.common.contactphotomanager.defaultimageprovider%29
android android-contacts
No comments:
Post a Comment