- Emulador: Nexus 5X, Android N
- Aula: Android II: Integração com apps e recursos do device
- Vídeo: Usando a câmera - 3
- Meu código: https://gist.github.com/anonymous/65849c41cd67f21720f34b5abf7c0cc2
Ao executar o projeto, ele chega a abrir, porém, ao tentar abrir a câmera, o seguinte erro é exibido no Android Studio:
FATAL EXCEPTION: main
Process: org.noctus.agenda, PID: 12042
android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/org.noctus.agenda/files/1470173604586.jpg exposed beyond app through ClipData.Item.getUri()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
at android.net.Uri.checkFileUriExposed(Uri.java:2346)
at android.content.ClipData.prepareToLeaveProcess(ClipData.java:832)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8909)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8894)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1517)
at android.app.Activity.startActivityForResult(Activity.java:4224)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:871)
at org.noctus.agenda.FormularioActivity$1.onClick(FormularioActivity.java:52)
at android.view.View.performClick(View.java:5609)
at android.view.View$PerformClick.run(View.java:22259)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Como resolver???
OBS: Até a aula 2 estava funcionando e camera abrindo.