breautek edited a comment on issue #758:
URL: 
https://github.com/apache/cordova-plugin-camera/issues/758#issuecomment-908441374


   This is normal behaviour on Android - a quirk due to the android Intent 
system and is documented in the [Android 
Quirks](https://github.com/apache/cordova-plugin-camera#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 result from the plugin call will be delivered via 
the resume event. See the Android Lifecycle guide for more information. The 
pendingResult.result value will contain the value that would be passed to the 
callbacks (either the URI/URL or an error message). Check the 
pendingResult.pluginStatus to determine whether or not the call was successful.
   
   In Android, any app that is not in the foreground process is susceptible to 
being closed/killed by the OS. When using intents - the app is placed in the 
background while the camera app is shown. When the activity is killed, the 
webview is also destroyed.
   
   I know this sucks and can be difficult to deal with but it's up to the 
developer to restore the state of their app in this situation. The camera 
results will also be included in the [resume 
event](https://cordova.apache.org/docs/en/dev/guide/platforms/android/index.html#retrieving-plugin-callback-results-cordova-android-510)
 in this situation.
   
   When the OS chooses to kill a background activity isn't explicitly defined, 
but it's usually related to when the OS feels the need to free up RAM, and 
operating the camera can be heavy on RAM.
   
   Closing this issue as not-a-bug; but if you have any other questions, feel 
free to ask and I'll try to answer them to the best of my ability.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to