4

I am using cordova 3.1 to access the camera on Android.

I used the

navigator.camera.getPicture

API to get an image, and I tested on Android 4.4.2 devices.

In Motorola Moto G it works fine. In Samsung Galaxy S5 it fails, restarting the application. When we try it with an image from Gallery, it works only when the image is of a small size (few KB).

Any one have the same issue for Samsung Galaxy S5? any solution?

WiPhone
  • 683
  • 6
  • 24
  • Any error ? and logs maybe? – Raptor Jul 03 '14 at 09:35
  • I am using Cordova 3.5 and a S5. I get the same problem intermittently as well. While this is no answer, it does appear to be a problem with Cordova and the S5. – tl8 Nov 04 '14 at 01:26
  • @tl8 I tried multiple things but I am not sure that it fixes the problem, you can try first to verify this http://stackoverflow.com/a/15626171/2115658 , then also try to add android:largeHeap="true" in your manifest and also use-feature tags http://stackoverflow.com/a/18941415/2115658 – WiPhone Nov 11 '14 at 14:02
  • I have the same issue. From what I understand it is merely that when android moves activities to the camera your app is being garbage collected because it is in the background. I, too, am still looking for a solution. – tslater Mar 07 '15 at 22:49
  • @tslater this is my understanding as well. Samsung's version of Android seems to be particularly aggressive in cleaning up background activities. Did you ever find a solution? – Keab42 Mar 18 '15 at 16:54
  • Sadly no! I think my solution for now is to write a treatise on the ionic forum and ask them to fork or create their own version of the plugin since I've found tons of other major issues with it. They seem more invested in cordova than adobe or any other people right now. I wish I had something better to say than that. – tslater Mar 19 '15 at 03:20

1 Answers1

1

I can't speak to Gallery retrieval, but I was able to prevent killing off my app's activity and launching a new instance on the S5 by setting a flag on the saved intent within the camera plugin:

intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

See my post here: https://stackoverflow.com/a/29630548/2782404

Community
  • 1
  • 1
kwills
  • 116
  • 10