Bläddra i källkod

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

liuxiaolong 7 månader sedan
förälder
incheckning
9f841e63d1

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){
+
+        }
+
+    }
 }