[ 
https://issues.apache.org/jira/browse/CB-8804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14595736#comment-14595736
 ] 

ASF GitHub Bot commented on CB-8804:
------------------------------------

Github user thehuijb commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/97#discussion_r32921498
  
    --- Diff: src/android/CameraLauncher.java ---
    @@ -163,7 +159,19 @@ else if ((srcType == PHOTOLIBRARY) || (srcType == 
SAVEDPHOTOALBUM)) {
                 PluginResult r = new 
PluginResult(PluginResult.Status.NO_RESULT);
                 r.setKeepCallback(true);
                 callbackContext.sendPluginResult(r);
    -            
    +
    +            return true;
    +        } else if (action.equals("checkForSavedResult")) {
    +            if (savedRequestCode > 0 || savedResultCode > 0) {
    +                processConfiguration(args);
    +                imageUri = Uri.fromFile(createCaptureFile(encodingType));
    +                onActivityResult(savedRequestCode, savedResultCode, 
savedIntent);
    +                savedRequestCode = 0;
    +                savedResultCode = 0;
    +                savedIntent = null;
    +            } else {
    +                callbackContext.success("");
    --- End diff --
    
    one should only return an error when an error occurs.
    @agrieve advised me to callback success with empty string so you can handle 
the result in onSuccess javascript like so:
    `if (result) {
      //do something
    }`
    



> 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]

Reply via email to