【发布时间】:2011-09-24 09:38:35
【问题描述】:
我知道我可以使用以下方法获取联系人照片的 URI:
Uri person = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId);
Uri photoUri = Uri.withAppendedPath(person, Contacts.Photo.CONTENT_DIRECTORY);
有没有办法为 RawContact 做同样的事情?
我试过了:
Uri person = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);
Uri photoUri = Uri.withAppendedPath(person, Contacts.Photo.CONTENT_DIRECTORY);
但它不起作用......
我需要一个 URI 而不是实际的 blob 的原因是因为代码位于 AppWidget 中,并且在将数据从小部件传递到启动器时似乎有几个兆的硬性限制,所以我需要使用setImageViewUri 而不是 setImageViewBitmap。
谢谢。
【问题讨论】:
-
您是否设法获得了 RawContact 照片?我也在寻找一种方法来获得它,但没有成功......
标签: android photos rawcontacts