1
I am having problems at the time of storing my photo, I create a folder using mkdir and through a string, I take the contents of an Edittext from my application, to give the name of the folder. After initializing the camera I wanted to save the photo in the same folder created, so I use the same string to save it:
@Override
public void onClick(View arg0){
nome = nomeNovo.getText().toString();
File folder = new File("sdcard/" + nome);
if (!folder.exists()){
pasta = folder.mkdir();
}
if (pasta == false){
linear.addView(teste);
}
else {
Intent intent = new Intent (MediaStore.ACTION_IMAGE_CAPTURE);
startActivity(intent);
// Toast.makeText(getApplicationContext(), "Endereço: sdcard/" + nome , Toast.LENGTH_SHORT).show();
File arquivo = new File("sdcard/" + nome);
}
The problem is that the photo is still being stored in the camera folder and not in the folder I created.
Okay, but what’s the problem?
– Pablo Almeida
The photo is being saved in the camera folder, not in the folder I created.
– Lucas Moraes de Souza
The code to do this is a little more complicated. Take a look here and in the official example. But basically the problem is that you are not passing to the application that will respond to your Intent the information about the file in which the photo is to be saved.
– Pablo Almeida