Android Question Intent Based Camera - Fails?

nicieri

Active Member
Licensed User
Longtime User
Hi, I downloaded this sample: https://www.b4x.com/android/forum/threads/intent-based-camera.69215/#content

If I try the sample, every works.

The problem is when I put the same code in my application (I added also the manifiest to my app), i get this error:

(SecurityException) java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.motorola.cameraone/com.motorola.camera.Camera clip={text/uri-list U:content://com.gpsafe.mysampleapp.provider/name/tempimage.jpg} (has extras) } from ProcessRecord{2e08a1c 20981:com.gpsafe.mimunicipio/u0a137} (pid=20981, uid=10137) with revoked permission android.permission.CAMERA

Any idea?

Thanks.
 

nicieri

Active Member
Licensed User
Longtime User
Is exactly the same code.

I solved adding this line before TakePicture:

Starter.rp.CheckAndRequest("android.permission.CAMERA")
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
"Intent Based Camera" does not need android.permission.CAMERA, because the camera is used by external Camera application.
Guess, you included a library Camera or Camera2 to your project. Did you mix "intent based camera" with camera / camera2 samples ?
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…