Closed yusrilmr closed 4 years ago
It seems I have found the solution. I should have called mPhotoEditor.clearAllViews();
every time I load a new image to the PhotoEditorView
.
So far, I have tested the saving several times and it is always a success.
Please close the issue if it's resolved.
When I use
OnSaveBitmap()
, it will always work fine only when I put a breakpoint inPhotoEditor.saveAsBitmap
, inside theAsyncTask
.Otherwise, sometimes, it does not trigger
onBitmapReady()
noronFailure()
at all. In the console, I also found this message:There are some references that I also found: https://stackoverflow.com/questions/25882768/async-task-stops-working-works-when-debugging-with-break-points-android https://stackoverflow.com/questions/14678593/the-application-may-be-doing-too-much-work-on-its-main-thread
It seems, somehow, the system skips some heavy processing in certain situations.
My short term solution is to show a loading dialog and tell users "Rendering image, please wait. If it takes too long, please press cancel and re-edit the image again."