Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mttkay
Created February 20, 2012 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mttkay/1868951 to your computer and use it in GitHub Desktop.
Save mttkay/1868951 to your computer and use it in GitHub Desktop.
Inserting a StreamItemPhoto
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