Here you can find the source of cacheAvatar(Context context, URI uri, Bitmap avatar)
private static void cacheAvatar(Context context, URI uri, Bitmap avatar)
//package com.java2s; import java.io.IOException; import java.net.URI; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.util.Log; public class Main { private static final String TAG = "SOHelper"; private static void cacheAvatar(Context context, URI uri, Bitmap avatar) { try {//www.jav a 2 s. co m avatar.compress(CompressFormat.PNG, 0, context.openFileOutput( String.format("%d.bmp", uri.hashCode()), Context.MODE_PRIVATE)); } catch (IOException ex) { Log.e(TAG, String.format("error caching %s", uri)); } } }