File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
android/src/main/java/com/pspdfkit/flutter/pspdfkit Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ protected void onCreate(Bundle bundle) {
3030 bindActivity ();
3131 }
3232
33+ @ Override
34+ protected void onDestroy () {
35+ super .onDestroy ();
36+ releaseActivity ();
37+ }
38+
3339 @ Override
3440 public void onDocumentLoaded (@ NonNull PdfDocument pdfDocument ) {
3541 super .onDocumentLoaded (pdfDocument );
@@ -52,6 +58,14 @@ private void bindActivity() {
5258 currentActivity = this ;
5359 }
5460
61+ private void releaseActivity () {
62+ Result result = loadedDocumentResult .getAndSet (null );
63+ if (result != null ) {
64+ result .success (false );
65+ }
66+ currentActivity = null ;
67+ }
68+
5569 public static FlutterPdfActivity getCurrentActivity () {
5670 return currentActivity ;
5771 }
You can’t perform that action at this time.
0 commit comments