Code example for Bitmap

Methods: compressisRecycledrecycle

0
		return output;
	} 
 
	public static boolean saveBitmapToFile(final Bitmap bitmap, String savePath) {
		boolean result = false;
		if (bitmap != null && !bitmap.isRecycled()) {
			File myDrawFile = new File(savePath);
			try { 
				BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(myDrawFile));
				bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);
				bos.flush();
				bos.close();
				result = true;
			} catch (Exception e) {
				Log.e("saveBitmapToFile", e);
			} finally { 
				if (bitmap != null) {
					bitmap.recycle();
				} 
			} 
		} 
		return result;
	} 
Contextual code suggestions in your IDE  Get Codota for Java