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();
}
}