cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-8917) Add api/way to get plugins results even when Cordova activity restarts
Date Wed, 11 Nov 2015 18:04:11 GMT


ASF GitHub Bot commented on CB-8917:

Github user riknoll commented on a diff in the pull request:
    --- Diff: framework/src/org/apache/cordova/ ---
    @@ -115,6 +115,10 @@ public boolean onActivityResult(int requestCode, int resultCode,
Intent intent)
                 savedResult = new ActivityResultHolder(requestCode, resultCode, intent);
                 if (pluginManager != null) {
                     callback = pluginManager.getPlugin(initCallbackService);
    +                if(callback != null) {
    +                    callback.onRestoreStateForActivityResult(savedPluginState.getBundle(callback.getServiceName()),
    --- End diff --
    I believe so. This will only be called after the Activity was destroyed in which case
`onSaveInstanceState()` will have been called and the `savedPluginState` bundle saved. I believe
Activity results are only delivered after `onCreate()` is called, so the Bundle will have
already been retrieved (but I can double check that). It is the responsibility of the plugin
to check if the bundle they receive is null.

> Add api/way to get plugins results even when Cordova activity restarts  
> ------------------------------------------------------------------------
>                 Key: CB-8917
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Bnaya
> In android when you have a plugin that opens new activity the CordovaActivity will be
killed and you won't get the result from the plugin.
> The new activity will get the results but because the plugin objects are dead and the
webview reloaded you can get the data to the js callback.
> The most noticeable example is the camera plugin. (And maybe its the same with even more
> possible solution for this is to add metadata to the device ready event with incoming
data from plugins.

This message was sent by Atlassian JIRA

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

View raw message