I still can't figure out what's causing my app to crash. I've already included permissions and user features but still wont work. How to solve this?
P.S. I'm new to Android.
I still can't figure out what's causing my app to crash. I've already included permissions and user features but still wont work. How to solve this?
P.S. I'm new to Android.
From What I can see you did not get Permission from User. (Adding Camera Permission in Manifest is not enough)
In onActivityResult
you have to get the image from data
variable. e.g Bitmap photo = (Bitmap) data.getExtras().get("data");
I recommend you have a look at this answer from @jengelsma, in how to Capture Image from Camera
.
https://stackoverflow.com/a/5991757/2945356
PS. If you change logcat filter to
ERROR
. It will show you exactly what is the problem
I believe that the cause of the problem is that your takePictureIntent()
calls startActivityForResult()
twice.
Also note that EXTRA_FINISH_ON_COMPLETION
does not apply to ACTION_IMAGE_CAPTURE
. PLease follow more closely the official Android tutorial.