How to capture image of any layout in background
<p>I am stuck in a problem from whole day</p>

<p>I want to send graphs in email. So for that i have captured bitmap of that graph and save it in sdcard as image. that works successfully</p>

<pre><code>private Bitmap TakeImage(View v) {
Bitmap screen = null;
 try {
     v.setDrawingCacheEnabled(true);

     v.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
          MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
     v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());

     v.buildDrawingCache(true);
     screen = v.getDrawingCache();
     v.setDrawingCacheEnabled(false); // clear drawing cache
} catch (Exception e) {
      e.printStackTrace();
}
return screen;
}
</code></pre>

<p>But now i want to capture that in background without showing that layout , without notify by user. My previous code does not work for that.
I require solution urgently.
Please any help is welcome</p>

<p>Thanks in advance</p>
