1

I have this method but why is it failing to create a directory in pictures folder?

    private void CreateDirectoryForPictures()
    {
        App._dir = new File(
            Android.OS.Environment.GetExternalStoragePublicDirectory(
                Android.OS.Environment.DirectoryPictures), "CameraAppDemo");
        if (!App._dir.Exists())
        {
            App._dir.Mkdirs();
        }
        if (!App._dir.Exists())
        {
            Toast.MakeText(this, "Directory not created", ToastLength.Short).Show();
        }
        else
        {
            Toast.MakeText(this, "Directory created", ToastLength.Short).Show();
        }

    }
jace
  • 1,634
  • 3
  • 14
  • 41

1 Answers1

3

Have you added the WRITE_EXTERNAL_STORAGE permission in the manifest?

Shubham Rana
  • 370
  • 1
  • 4
  • 12