Is better to use a validation to support versions pre Android N, example:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
imageUri = Uri.parse(filepath);
} else{
imageUri = Uri.fromFile(new File(filepath));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
ImageView.setImageURI(Uri.parse(new File("/sdcard/cats.jpg").toString()));
} else{
ImageView.setImageURI(Uri.fromFile(new File("/sdcard/cats.jpg")));
}