Method does not save photo archive

0

I'm making an application on Android, but I can not 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 a Samsung with Android 6.0.1 to test.

    
asked by anonymous 06.01.2017 / 22:04

0 answers