Skip to content Skip to sidebar Skip to footer

Save Imageview To Android Emulator Gallery

I'd like to Save an Image to the Android Gallery, here's my current code: image.setDrawingCacheEnabled(true); image.buildDrawingCache(true); Bitmap b = image.getDrawingCache(); i

Solution 1:

Since, you already have the Bitmap you can use this code to insert it into the gallery:

Bitmapb= image.getDrawingCache();
Images.Media.insertImage(getContentResolver(), b, title, description);

title and description can be null if you don't care about setting them. If the Uri returned is non-null, then the insertion was successful.

Post a Comment for "Save Imageview To Android Emulator Gallery"