I have a camera project and im using camera2 API
especially from this link
https://github.com/googlesamples/android-Camera2Basic
I can save the picture taken to my file manager located at DCIM/camera
for example, but when I open my gallery, it wont show my last picture.
Can anyone help me?
One more question, I want to make my camera can be a list: for example, when I open "LINE" and I want take picture with camera, I want my camera appears and can be chosen.
This is the sample code I tried for saving picture to the custom path:
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mFile = new File("/storage/emulated/0/DCIM/Camera", "pic.jpg");
int counter=1;
while (mFile.exists()) {
mFile = new File("/storage/emulated/0/DCIM/Camera", "pic" + String.format("%02d", counter) + ".jpg");
counter++;
}
}