You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Julian Frumar (JIRA)" <ji...@apache.org> on 2015/09/12 02:44:46 UTC

[jira] [Updated] (CB-9649) Camera Plugin crashes the app when restarting MainActivity

     [ https://issues.apache.org/jira/browse/CB-9649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Frumar updated CB-9649:
------------------------------
    Description: 
On my Samsung S5 test device, when taking a photo with image stabilization on, it shuts down our app in the background (likely due to memory constraints) and then restarts our app once the image has been captured.

The Camera plugin assumes that this.imageUri (https://github.com/apache/cordova-plugin-camera/blob/master/src%2Fandroid%2FCameraLauncher.java#L387)  is still available in memory, but  it isn't available if the app was to restarted (this.imageUri is not persisted anywhere).

Because the intent is triggered with intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)), when the onActivityResult is called there is no intent provided (so no way of loading the URI to the saved image).

Suggestion: By removing the EXTRA_OUTPUT on the launching intent, the camera will return the URI in the returning intent which can then be read.

  was:
On my Samsung S5 test device, when taking a photo with image stabilization on, it shuts down our app in the background (likely due to memory constraints) and then restarts it once the image is captured.

The Camera plugin assumes that this.imageUri is still available in memory, but  it isn't available if the app had to restart (it's not persisted anywhere).

Because the intent is triggered with intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)), when the onActivityResult is called there is no intent provided (so now way of loading the URI to the saved image).

Suggestion: By removing the EXTRA_OUTPUT on the launching intent, the camera will return the URI in the returning intent which can then be read.


> Camera Plugin crashes the app when restarting MainActivity
> ----------------------------------------------------------
>
>                 Key: CB-9649
>                 URL: https://issues.apache.org/jira/browse/CB-9649
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Camera
>    Affects Versions: 1.2.1
>         Environment: Android Lollipop
>            Reporter: Julian Frumar
>
> On my Samsung S5 test device, when taking a photo with image stabilization on, it shuts down our app in the background (likely due to memory constraints) and then restarts our app once the image has been captured.
> The Camera plugin assumes that this.imageUri (https://github.com/apache/cordova-plugin-camera/blob/master/src%2Fandroid%2FCameraLauncher.java#L387)  is still available in memory, but  it isn't available if the app was to restarted (this.imageUri is not persisted anywhere).
> Because the intent is triggered with intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo)), when the onActivityResult is called there is no intent provided (so no way of loading the URI to the saved image).
> Suggestion: By removing the EXTRA_OUTPUT on the launching intent, the camera will return the URI in the returning intent which can then be read.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org