title: Mono for Android Save into Gallery's Directory
body: <p>Im trying to save into SD card and if is not available into save it into Internal memory on the Gallery, but always showing on the Galley directory. But this code is not saving it or how can i do to show it into Gallerys Directory. </p>
  
  <pre><code> string nameFile = file + ".png"; 
              //Check wether the sd card is available or not
              string state = Android.OS.Environment.ExternalStorageState;
  
              bool isExternalStorageAvailable = false;
              bool isExternalStorageWritable = false;
  
              string path = null;
  
              if(Android.OS.Environment.MediaMounted.Equals(state))
              {
                 isExternalStorageAvailable = isExternalStorageWritable = true;
                 //var path = Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryMusic);
                 path = Android.OS.Environment.ExternalStorageDirectory.ToString();
                 Toast.MakeText(this, "Saved in SDCard", ToastLength.Short).Show();
              }
              else if(Android.OS.Environment.MediaMountedReadOnly.Equals(state))
              {
                 isExternalStorageAvailable = true;
                 isExternalStorageWritable = false;
              }
              else 
              {
                //path = Android.OS.Environment.DataDirectory;
                path = Android.OS.Environment.DirectoryPictures;
                Toast.MakeText(this, "Saved in Internal Memory ", ToastLength.Short).Show();
              }
  
              //Create a  Bitmap screen capture
              Android.Graphics.Bitmap bitmap;
              View view = v.RootView;
              view.DrawingCacheEnabled = true;
              bitmap = Android.Graphics.Bitmap.CreateBitmap(view.DrawingCache);
              view.DrawingCacheEnabled = false;
  
              System.IO.FileStream fs = null;
              try
              {
                  fs = new System.IO.FileStream(path + "/" + nameFile, System.IO.FileMode.OpenOrCreate);
                  bitmap.Compress(Android.Graphics.Bitmap.CompressFormat.Png, 100, fs);
                  if(isExternalStorageAvailable == true &amp;&amp; isExternalStorageWritable == true)
                  {
                     //SendBroadcast(new Intent(Intent.ActionMediaMounted, Android.Net.Uri.Parse(path + "/" + nameFile)));
                     MyMediaConnectorClient client = new MyMediaConnectorClient(path + "/" + nameFile);
                     MediaScannerConnection scanner = new MediaScannerConnection(this, client);
                     client.SetScanner(scanner);
                     scanner.Connect();
                  }
                  else
                  {                  
                     Android.Provider.MediaStore.Images.Media.InsertImage(ContentResolver, bitmap, nameFile, v.Id.ToString());
                  }
  
                  fs.Flush();
              }
              catch(FileNotFoundException e)
              {
                  Log.Error("File Not Found Exception", e.ToString());
              }
              catch(IOException e)
              {
                  Log.Error("IOException", e.ToString());
              }
              finally
              {
                  if (fs != null)
                      fs.Close();     
                      dialog.Dismiss();
              }
  </code></pre>