while Selecting image, I am getting error Access to the path "/storage/emulated/0/i.jpeg" is denied.

            when I debug the below code in my mobile I get the following error. Attached screenshot of the error. 

            Uri uri = data.Data;
            bb = uri;
            //Toast.MakeText (this, "2nd if", ToastLength.Short).Show ();
            Bitmap bmp=BitmapFactory.DecodeStream(ContentResolver.OpenInputStream(uri));
            var sdCardPath = Android.OS.Environment.ExternalStorageDirectory.Path + "";;

            var filePath = System.IO.Path.Combine(sdCardPath, "i.jpeg");
            var stream = new FileStream(filePath, FileMode.Create);
            bmp.Compress(Bitmap.CompressFormat.Png, 100, stream);
            _imageView_Hall.SetImageBitmap (Bitmap.CreateScaledBitmap(bmp, 1200, 1200, true));
            bmp = null;
Sign In or Register to comment.