[TIMOB-28194] Android: After calling Ti.Media.takePicture() once, it doesn't return a result again
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2021-02-25T21:50:29.000+0000 |
Affected Version/s | Release 9.3.0, Release 9.2.1 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Unknown |
Created | 2020-10-14T14:16:57.000+0000 |
Updated | 2021-02-25T21:50:29.000+0000 |
Description
Due to TIMOB-28190, we are exploring custom camera overlays to take pictures manually. While that works great on iOS, we noticed the following issue on Android:
We created an overlay that takes a pictures and previews it on-screen. After selecting the "Use" button, it calls
Ti.Media.hideCamera()
and returns everything correctly. But if we add a "Retake" button that clears the taken image and shows the camera again, calling Ti.Media.takePicture()
does not call the "success" event of the Ti.Media.showCamera
API again. The issue is likely caused by the "TiCameraActivity" guard takingPicture
which probably is not reset correctly. Unfortunately, there is no way to workaround that, since the guard is set natively.
An always-to-reproduce test case can be taken from our app (branch: fix/camera-view)
I assume these are the steps to reproduce?
Tap on the "Chat" tab.
Tap on a conversation row.
Tap the "+" button and select "Camera" from dialog.
Tap the "Cancel" button in the camera preview window.
Tap the "+" button and select "Camera" from dialog.
Tap on the capture button.
Notice capture button spins forever. Success callback never invoked.
I was able to reproduce this in Titanium 9.2.0. I've also confirmed that Titanium 9.3.0 has already fixed it via the following PR. We've made several other fixes/improvements to the camera overlay activity that you'll probably want. https://github.com/appcelerator/titanium_mobile/pull/12143Thanks Josh, thats good to hear! We went with removing the photo confirmation to upload the photo immediately, but will add the confirmation step again, once we update to 9.3.0. This can probably be closed then!