From 69b60944b4ae081d58ce2c5aa0b24ea0afd38ded Mon Sep 17 00:00:00 2001 From: r-ca Date: Tue, 9 Jan 2024 14:09:05 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9A=AB=E5=AE=9A)=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=83=8F=E3=83=B3=E3=83=89=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scanner/ScannerDataManagerStubFragment.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java index 2d15b51b..ee5ef1f5 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java @@ -185,9 +185,21 @@ public class ScannerDataManagerStubFragment extends Fragment { bitmaps[i] = results.get(i).getBitmap(); } - this.documentProcessor.addNewPagesToLast(bitmaps); + try { + this.documentProcessor.addNewPagesToLast(bitmaps); + } catch (Exception e) { + Toast.makeText(getActivity(), "Error occurred while adding pages", Toast.LENGTH_LONG).show(); + Log.e("ScannerDataManagerStubFragment", "Error occurred while adding pages", e); + } - this.documentProcessor.close(); + Toast.makeText(getActivity(), "pages added", Toast.LENGTH_LONG).show(); + + try { + this.documentProcessor.close(); + } catch (Exception e) { + Toast.makeText(getActivity(), "Error occurred while closing documentProcessor", Toast.LENGTH_LONG).show(); + Log.e("ScannerDataManagerStubFragment", "Error occurred while closing documentProcessor", e); + } }); }