title: Convert View to bitmap FileNotFoundException problem
body: <p>I'm trying to convert my LinearLayout to a bitmap so that I can save the current layout content as an image in SD card. First, I create bitmap and canvas and attach the layout to the canvas. Followed steps from <a href="http://www.brighthub.com/mobile/google-android/articles/30676.aspx#comments" rel="nofollow noreferrer">http://www.brighthub.com/mobile/google-android/articles/30676.aspx#comments</a>. </p></p>
  
  <pre><code>//code to add child view into layout before creating bitmap 
  screenBitmap = Bitmap.createBitmap(200,200,Bitmap.Config.ARGB_8888);
  Canvas canvas = new Canvas(screenBitmap);
  layout.draw(canvas);   
  </code></pre>
  
  <p><p> When I press the save button, it should save the current layout as an image to SD card. Here are my steps:</P></p>
  
  <pre><code>FileOutputStream outStream = null;
  File file = new File("/sdcard/Health Management System/");
  file.mkdirs();
  
  File outputFile = new File(file, fileName);
  outStream = new FileOutputStream(outputFile);
  BufferedOutputStream bos = new BufferedOutputStream(outStream);
  
  bos.flush();
  bos.close();
  
  screenBitmap.compress(Bitmap.CompressFormat.PNG, 100,bos);
  </code></pre>
  
  <p><p> It can create folder in SD card but no file created under this folder. It always gives me FileNotFoundException. I'm not sure it is the file creating problem or the screenBitmap problem. Can anyone give me some clue? Thanks! </p>