'How can i direct to the PDF file generated by clickable notification

Hello, I am making a project where the record contains ID, Name, Status And I have save it as a PDF the data, and its gets a notification after getting saved, No I wanted to know how can I make that clickable and direct to file. Below is the code I tried, but not working

 Intent notificationIntent = new Intent(Intent.ACTION_VIEW);
    notificationIntent.addCategory(Intent. CATEGORY_APP_FILES) ;
    notificationIntent.setDataAndType(Uri.parse(filePath), "application/pdf");
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
    PendingIntent resultIntent = PendingIntent. getActivity (SheetActivity. this, 0 , notificationIntent ,  0) ;
    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder
            (SheetActivity. this, default_notification_channel_id )
            .setSmallIcon(R.drawable. mcclogo )
            .setContentTitle("PDF saved")
            .setContentText(filePath)
            .setContentIntent(resultIntent) ;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source