Skip to content

Instantly share code, notes, and snippets.

@parallelcross
Created August 28, 2014 16:25
Show Gist options
  • Save parallelcross/bead6bb63c2f8ccb671b to your computer and use it in GitHub Desktop.
Save parallelcross/bead6bb63c2f8ccb671b to your computer and use it in GitHub Desktop.
Bitmap bitmap = ((BitmapDrawable)viewHolder.productImage.getDrawable()).getBitmap();
int [] colors = new int[1];
colors[0] = bitmap.getPixel(0, 0);
Bitmap backgroundBitmap = Bitmap.createBitmap(colors, 1, 1, Bitmap.Config.ARGB_8888);
viewHolder.productImage.setBackgroundDrawable(new BitmapDrawable(backgroundBitmap));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment