title: Save ImageView to Android Emulator Gallery
body: <p>I'd like to Save an Image to the Android Gallery, here's my current code:</p>
  
  <pre><code>image.setDrawingCacheEnabled(true);
  
  image.buildDrawingCache(true);
  Bitmap b = image.getDrawingCache();
  
  if(!new File("/"+Environment.DIRECTORY_PICTURES).exists())
      Log.e("Error","/"+Environment.DIRECTORY_PICTURES+" Dont exist");
  
  File file = new File(Environment.DIRECTORY_PICTURES+"/myImage.jpg");
  file.createNewFile();
  FileOutputStream ostream = new FileOutputStream(file);
  b.compress(CompressFormat.JPEG, 80, ostream);
  image.setDrawingCacheEnabled(false);
  ostream.close();
  Toast.makeText(Ads.this, "Offer saved", 1).show();
  </code></pre>
  
  <p>It always returns the same error:</p>
  
  <pre><code>Error: /Pictures Dont exist
  </code></pre>
  
  <p>Then an IOException:</p>
  
  <pre><code>java.io.IOException: open failed: ENOENT (No such file or directory)
  </code></pre>
  
  <p>This is on a 4.0 Android Virtual Device.
  I've tried to use <code>Environment.getRootDirectory()</code> to get the root directory of the AVD also, but I still receive the same errors.</p>
  
  <p>What is the correct way to test saving an image to gallery in an AVD?</p>