Boa tarde! Estou com um problema ao executar o APP Agenda. Acompanhei a resolução do problema para Android 7+ no final da aula, mas mesmo assim, ao tirar a foto do contato, a ImageView não é populada. Estou rodando o app num Moto Z, Android 7.1.1
Link do projeto no GitHub
https://github.com/rdgosmartins/alura
Manifest:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
filepaths.xml:
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="." />
</paths>
Java
Intent intentCamera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
caminhoFoto = getExternalFilesDir(null) + "/" + System.currentTimeMillis() + ".jpg";
File arquivoFoto = new File(caminhoFoto);
intent.putExtra(MediaStore.EXTRA_OUTPUT,
FileProvider.getUriForFile(FormularioActivity.this,
BuildConfig.APPLICATION_ID + ".provider", arquivoFoto));
startActivityForResult(intentCamera, CODIGO_CAMERA);