FileProvider.getUriForFile returns null
I'm trying to take a photo in my device's camera, when I call the method that handles the image capture the app crashes because of a nullpointer exception. I don't know what information is missing with my FileProvider as the stacktrace points the nullpointer into my FileProvider.getUriForFile statement. Here's my code HomeActivity public void takePhoto(View view){ //camera stuff Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); //folder stuff File imagesFolder = new File(Environment