Android examples for android.graphics:Bitmap Load Save
set Bitmap to a file by file name
import java.io.FileNotFoundException; import java.io.FileOutputStream; import android.content.Context; import android.graphics.Bitmap; public class Main { public static void setInternalBitmap(Context c, String filename, Bitmap bitmap) { try {/*from ww w . jav a 2 s . c o m*/ FileOutputStream fos = c.openFileOutput(filename, Context.MODE_PRIVATE); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos); } catch (FileNotFoundException e) { e.printStackTrace(); } } }