Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10554

Media Capture: Null reference in low memory conditions

    XMLWordPrintableJSON

Details

    • Important

    Description

      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

      7 14:30:31.181 23432-24842/com.ionicframework.alto442183 E/AndroidRuntime: FATAL EXCEPTION: pool-3-thread-2
      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 org.apache.cordova.mediacapture.Capture$3.run(Capture.java:396)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      at java.lang.Thread.run(Thread.java:818)

      Attachments

        Activity

          People

            riknoll Richard B Knoll
            adamduren Adam Duren
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: