I want to set the photo in the imageview

1

I'm new to programming and I'm having difficulty setting the photo on imageview , being already taking a photo and saving in the gallery, but not setting.

public void usarCamera() {

        File diretorio = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
        File imagem = new File(diretorio.getPath() + "/" + System.currentTimeMillis() + ".jpg");
        uri  = Uri.fromFile(imagem);

        Intent intentCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        intentCamera.putExtra(MediaStore.EXTRA_OUTPUT, uri);
        startActivityForResult(intentCamera, CAMERA);
    }


    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

               if(resultCode == RESULT_OK && requestCode == GALERIA_IMAGENS){
                Intent novaIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri);
                sendBroadcast(novaIntent);
                caminhoDaImagem = uri.getPath();
            }
        }
    
asked by anonymous 20.03.2018 / 21:36

1 answer

-1

Try Picasso for this: link

It would look something like:

Picasso.get()
    .load(caminhoDaImagem)
    .into(imageview)
    
21.03.2018 / 14:22