Saving a canvas to Bitmap then saving the Bitmap
<p>This is surrounded in a try, catch for the writing part, but if it isn't in a try catch methods, the app seems to crash in the emulator.
I'm trying to save the canvas as a bitmap, then saving the bitmap to the storage...</p>

<pre><code>screenshot = Bitmap.createBitmap(screenshot, 0, 0, 0, 0);
Canvas can = new Canvas(screenshot);
int i = 0;
String filename = "EnderShot";
while (new File(filename + i + ".png") != null){
    FileOutputStream fos = null;
    fos = openFileOutput(filename + i + ".png", Context.MODE_PRIVATE);
    fos.write(screenshot.getByteCount());
    fos.close();
}
</code></pre>

<p>This also saves it... So if anyone could work it out?</p>
