Here you can find the source of view2Bitmap(View view, boolean cache)
public static final Bitmap view2Bitmap(View view, boolean cache)
//package com.java2s; import android.graphics.Bitmap; import android.view.View; public class Main { public static final Bitmap view2Bitmap(View view) { return view2Bitmap(view, false); }/* ww w . j a v a 2 s . c o m*/ public static final Bitmap view2Bitmap(View view, boolean cache) { view.setDrawingCacheEnabled(cache); view.buildDrawingCache(); Bitmap bitmap = view.getDrawingCache(); return bitmap; } }