Eventually I found this article
https://medium.com/@ali.muzaffar/what-is-android-os-fileuriexposedexception-and-what-you-can-do-about-it-70b9eb17c6d0
and here what I get
Manifest
<manifest ...>
<application ...>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
</application>
</manifest>
Create XML file res/xml/provider_paths.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>
Code changes
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File(iImagePath); // set your image path
Uri uri = FileProvider.getUriForFile(iC, iC.getApplicationContext().getPackageName() + ".provider", file);
intent.setDataAndType(uri, "image/*");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
PendingIntent pIntent = PendingIntent.getActivity(iC, 0, intent, 0);
Bitmap bm = BitmapFactory.decodeFile(iImagePath);
NotificationCompat.Builder builder = mScreenshotBuilder.setContentTitle(iC.getString(R.string.screenshot_saved))//
.setContentText(iC.getString(R.string.tap_to_view_your_screenshot))//
.setContentIntent(pIntent);