소스 검색

PDFTool(Android) - v2.0.1 替换sdk, 优化内存占用问题

liuxiaolong 7 달 전
부모
커밋
9f841e63d1
2개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. BIN
      ComPDFKit_Repo/compdfkit/ComPDFKit.aar
  2. 13 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFDocumentFragment.java

BIN
ComPDFKit_Repo/compdfkit/ComPDFKit.aar


+ 13 - 0
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFDocumentFragment.java

@@ -799,4 +799,17 @@ public class CPDFDocumentFragment extends CBasicPDFFragment {
     protected interface CRequestPermissionListener {
         void request();
     }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        try {
+            if (pdfView.getCPdfReaderView().getPDFDocument() != null) {
+                pdfView.getCPdfReaderView().getPDFDocument().close();
+            }
+        }catch (Exception e){
+
+        }
+
+    }
 }