Android Save Canvas into Bitmap
<p>I have been struggling on converting a Canvas to a Bitmap. <br />
Here is my code on the onDraw function. I have tried many variations and I still didn't get an answer. <br /></p>

<pre><code>    @Override
public void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    Bitmap bitmap = Bitmap.createBitmap(canvas.getWidth(),canvas.getHeight(),Bitmap.Config.ARGB_8888);  
    canvas.setBitmap(bitmap);
    for(List&lt;Point&gt; pointA : pointWhole)
    {
        Point prev = null;
        for (Point point : pointA) {
            if(prev != null)
            {
                canvas.drawLine(prev.x, prev.y, point.x, point.y, paint);
            }
            prev = point;
        }
    }
}
</code></pre>

<p>It doesn't seem to save the whole bitmap.</p>
