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-10554) Media Capture: Null reference in low memory conditions
Date Wed, 16 Mar 2016 21:05:33 GMT


ASF GitHub Bot commented on CB-10554:

Github user riknoll commented on the pull request:
    @adamduren  I've tested this and the save/restore stuff appears to work great! There is
an issue, however, with the results that are returned in the resume event. They need to be
wrapped in `MediaFile` objects before use. This was also an issue in the Contacts plugin where
they needed to be wrapped in a `Contact` object and the solution was to just provide an example
of how to do that in the README (see [here](
In this plugin it is a little bit trickier because we need to decide how to expose the `MediaFile`
object creation. Currently, it just happens in the `exec` callback [here](
without a public API. Thoughts? Maybe we should add a `MediaFile` constructor that encapsulates
that `exec` callback? That at least would not be a breaking change.

> Media Capture: Null reference in low memory conditions
> ------------------------------------------------------
>                 Key: CB-10554
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Media Capture
>         Environment: android
>            Reporter: Adam Duren
>            Assignee: Richard B Knoll
>            Priority: Critical
>              Labels: PR, android, pendingPR, triaged
> I have been testing my app in low memory conditions by setting the android developer
setting of "Don't keep Activities" which simulates low memory conditions. Every time I use
the capture plugin for video when returning from the capture activity the app crashes. It
appears that the state is not saved and on resume there are now null references such as the
callbackContext and results array. It is fixed by using the onRestoreStateForActivityResult
and onSaveInstanceState methods.
> *Related Exception* 
> {quote}
> 7 14:30:31.181 23432-24842/com.ionicframework.alto442183 E/AndroidRuntime: FATAL EXCEPTION:
>                                                                                Process:
com.ionicframework.alto442183, PID: 23432
>                                                                                java.lang.NullPointerException:
Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.sendPluginResult(org.apache.cordova.PluginResult)'
on a null object reference
>                                                                                    at
>                                                                                    at
>                                                                                    at
>                                                                                    at
> {quote}

This message was sent by Atlassian JIRA

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

View raw message