I have learned to do this for an image view that is already implemented in the xml file and just take one picture from the camera. I am still unable to implement this so the user can take many pictures and they would become saved in different image views. Thx for the help in advanced
Asked
Active
Viewed 21 times
0
-
Possible duplicate of [Capture Image from Camera and Display in Activity](https://stackoverflow.com/questions/5991319/capture-image-from-camera-and-display-in-activity) – K.Sopheak Aug 03 '17 at 01:55
2 Answers
0
Yu can first create a grid view or a linear layout on your activity, then when onActivityResult is called you can do something like this :
ImageView img = new ImageView(MyActivity.this);
img.setImageResource(ImageFromResult);

Prasheel
- 985
- 5
- 22
0
You may wish to look at photo basics, which is a detailed example on how to achieve just that.
To summarize it:
- Ensure you have the camera permissions
- Launch the intent with
onActivityResult
after you've successfully created a temp file. The URI will be passed through the intent so the image will be saved there - On an activity result, see if it matches the request code and handle the image from there. It is exactly like loading an image file into your ImageView.
Note that you do not need write permissions, as you can freely create files in your app's data directory.

Allan W
- 2,791
- 4
- 23
- 41