Created
February 20, 2012 12:08
-
-
Save mttkay/1868951 to your computer and use it in GitHub Desktop.
Inserting a StreamItemPhoto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void addStreamItemPhoto(String photoUrl, long streamItemId, String accountName) { | |
byte[] photoData = downloadPhoto(photoUrl); | |
ContentValues values = new ContentValues(); | |
values.put(StreamItems.ACCOUNT_NAME, accountName); | |
values.put(StreamItems.ACCOUNT_TYPE, "com.yourapp.account"); | |
values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId); | |
values.put(StreamItemPhotos.PHOTO, photoData); | |
resolver.insert(StreamItems.CONTENT_PHOTO_URI, values); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment