Reputation: 1674
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();
}
}
Upvotes: 1
Views: 661
Reputation: 410
Have you added the WRITE_EXTERNAL_STORAGE permission in the manifest?
Upvotes: 3