cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thehuijb <>
Subject [GitHub] cordova-android pull request: solves CB-8768 issue where onActivit...
Date Mon, 30 Mar 2015 14:12:21 GMT
Github user thehuijb commented on a diff in the pull request:
    --- Diff: framework/src/org/apache/cordova/ ---
    @@ -314,10 +318,52 @@ public void startActivityForResult(Intent intent, int requestCode,
Bundle option
          * @param intent            An Intent, which can return result data to the caller
(various data can be attached to Intent "extras").
    -    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    +    protected void onActivityResult(final int requestCode, final int resultCode, final
Intent intent) {
             LOG.d(TAG, "Incoming Result. Request code = " + requestCode);
             super.onActivityResult(requestCode, resultCode, intent);
    -        cordovaInterface.onActivityResult(requestCode, resultCode, intent);
    +        // check if plugins are ready to receive the result
    +        if (this.pluginsReady) {
    +            cordovaInterface.onActivityResult(requestCode, resultCode, intent);
    +            this.findCallbackTries = 0;
    +        } else {
    +            /**
    +             * If the Android OS kills this activity when a plugin launches an a new
    +             * the onActivityResult event fires before the onResume event 
    +             * so we have to wait for the plugins to be loaded again before we can hand
the result to the correct plugin.
    +             */
    +            final ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1);
    --- End diff --
    thanks for having a look and commenting.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message