Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.FormsImageView'.

duma23duma23 RSMember ✭✭

I'm getting this exception and I have no idea why.
First I changed something in signature pad component so it can work now as photo editor. In activity that uses component, I save edited image like this:

using (var fs = new FileStream(path, FileMode.Create)) { image.Compress(Bitmap.CompressFormat.Jpeg, 100, fs); };

Everything works fine, except this case. On page where I take picture, I show picture after taking and under the pic I have edit button that opens signature pad, where you can edit and than save it. And edited picture is shown, and you can open as many times as you want and it works as it should. This exception I get, when I open edited picture later, from list of photos, where you can again edit it, and after that edit on save this exception popout.
Have you any idea why this happens?

Thanks!

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    I'm getting this exception and I have no idea why.

    Because the object has been disposed of... Then you tried to access it.

    With so little code to go on the only object I think it could be is the 'image' object.

Sign In or Register to comment.