From ab8950a5af499c6464f151a393f632cebc228c2a Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Thu, 9 Dec 2010 14:13:23 -0600 Subject: [PATCH] Re-enable multitasking in onResume Java callback so that onResume JS handlers are called - it was being re-enabled too soon. --- framework/src/com/phonegap/DroidGap.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java index ca548684..a7387a27 100755 --- a/framework/src/com/phonegap/DroidGap.java +++ b/framework/src/com/phonegap/DroidGap.java @@ -621,7 +621,13 @@ public class DroidGap extends PhonegapActivity { super.onResume(); // If app doesn't want to run in background - if (!this.keepRunning) { + if (!this.keepRunning || this.activityResultKeepRunning) { + + // Restore multitasking state + if (this.activityResultKeepRunning) { + this.keepRunning = this.activityResultKeepRunning; + this.activityResultKeepRunning = false; + } // Forward to plugins this.pluginManager.onResume(); @@ -1089,9 +1095,6 @@ public class DroidGap extends PhonegapActivity { Plugin callback = this.activityResultCallback; if (callback != null) { callback.onActivityResult(requestCode, resultCode, intent); - - // Restore multitasking state - this.keepRunning = this.activityResultKeepRunning; } }