Here you can find the source of saveMyBitmap(String bitName, Bitmap mBitmap)
public static void saveMyBitmap(String bitName, Bitmap mBitmap)
//package com.java2s; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import android.graphics.Bitmap; public class Main { public static void saveMyBitmap(String bitName, Bitmap mBitmap) { File f = new File(bitName); try {/* ww w . j a va2 s . c om*/ f.createNewFile(); } catch (IOException e1) { e1.printStackTrace(); } FileOutputStream fOut = null; try { fOut = new FileOutputStream(f); } catch (FileNotFoundException e) { e.printStackTrace(); } mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut); try { fOut.flush(); } catch (IOException e) { e.printStackTrace(); } try { fOut.close(); } catch (IOException e) { e.printStackTrace(); } } }