Method not saving photo file

Asked

Viewed 29 times

0

I’m making an application on Android, only I can’t save a photo file.

btnFoto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // Intent de camera
                Intent itCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                //Caminho da foto
                caminhoFoto = getExternalFilesDir(null) + "/foto"+System.currentTimeMillis()+".jpg";
                Log.i("foto", caminhoFoto);
                // Criando objeto do tipo File
                File arquivoFoto = new File(caminhoFoto);
                // Paddando o Arquivo da foto por put Extra
                itCamera.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(arquivoFoto));
                //
                startActivityForResult(itCamera, CODIGO_CAMERA);
            }
        });

Obs: I’m using for testing a Samsung with Android 6.0.1.

  • Hi, would you like to save the photo where?

  • Error?

  • Have you checked on the permission issues?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.