[
https://issues.apache.org/jira/browse/CB-8804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14592749#comment-14592749
]
ASF GitHub Bot commented on CB-8804:
------------------------------------
Github user dpolivy commented on the pull request:
https://github.com/apache/cordova-plugin-camera/pull/97#issuecomment-113321831
I am looking at porting this into my fork of the camera plugin, and have a
few suggestions/improvements to add (some I've addressed, some not yet). I'm
not 100% done yet, but here's what I've seen off the bat:
* After retrieving the saved result, you should zero/null out the saved*
instance variables.
* Creating this.imageUri should only happen inside the `if
(savedRequestCode > 0...` block.
* The `onActivityResult` code can be simplified to just `return` after
saving the values, to avoid the extra `else` block around the existing method.
* The `encodingType` is assumed to be JPEG when creating the temp file.
This may not be the user's desired encoding. Is it possible to save some of the
instance variables away in `onSaveInstanceState()`?
* Related to the prior comment, it might make sense for
`checkForSavedResult` to take the same CameraOptions object that was passed to
the original call, so it can properly restore state in the object.
I've updated my Nexus 5 to Android 5.1.1, and with the "always destroy
activities" developer setting enabled, sometimes I'm finding that my main
activity isn't being resumed at all -- after the camera disappears, I am left
on the device home screen. Anyone else seen this?
> https://github.com/apache/cordova-plugin-camera#android-quirks
> --------------------------------------------------------------
>
> Key: CB-8804
> URL: https://issues.apache.org/jira/browse/CB-8804
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Plugin Camera
> Environment: Android
> Reporter: Serge Huijben
>
> Android Quirks
> Android uses intents to launch the camera activity on the device to capture
> images, and on phones with low memory, the Cordova activity may be killed. In
> this scenario, the image may not appear when the Cordova activity is restored.
> It can be solved bij implementing this PR:
> https://github.com/apache/cordova-plugin-camera/pull/97
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]