I've got exception when called whenAvailable() on PendingResult:
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:129)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20)
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:98)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
at java.util.concurrent.FutureTask.report(FutureTask.java:94)
at java.util.concurrent.FutureTask.get(FutureTask.java:160)
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:127)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20)
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:98)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:522)
at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:540)
at io.fotoapparat.result.transformer.BitmapPhotoTransformer.readImage(BitmapPhotoTransformer.java:53)
at io.fotoapparat.result.transformer.BitmapPhotoTransformer.transform(BitmapPhotoTransformer.java:29)
at io.fotoapparat.result.transformer.BitmapPhotoTransformer.transform(BitmapPhotoTransformer.java:14)
at io.fotoapparat.result.PendingResult$1.call(PendingResult.java:55)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
I've got exception when called whenAvailable() on PendingResult:
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:129) at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20) at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:98) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:841) Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError at java.util.concurrent.FutureTask.report(FutureTask.java:94) at java.util.concurrent.FutureTask.get(FutureTask.java:160) at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:127) at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20) at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:98) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:841) Caused by: java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method) at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:522) at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:540) at io.fotoapparat.result.transformer.BitmapPhotoTransformer.readImage(BitmapPhotoTransformer.java:53) at io.fotoapparat.result.transformer.BitmapPhotoTransformer.transform(BitmapPhotoTransformer.java:29) at io.fotoapparat.result.transformer.BitmapPhotoTransformer.transform(BitmapPhotoTransformer.java:14) at io.fotoapparat.result.PendingResult$1.call(PendingResult.java:55) at java.util.concurrent.FutureTask.run(FutureTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:841)
Is there any way to fix it?