I am tring to open an uploaded file through notifications, but it is not working, the notification appears but once I click on it, nothing happens.
This is the notification part of my code :
Uri uri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Intent i = new Intent();
i.setAction(android.content.Intent.ACTION_VIEW);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.setDataAndType(Uri.parse("file://"+file_path), f.getString("type") );
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent contentIntent = PendingIntent.getActivity(Main.this, 0, i , 0);
mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mBuilder = new NotificationCompat.Builder( BabupMain.this);
mBuilder.setContentTitle("test").addAction(android.R.drawable.alert_dark_frame, "hi",contentIntent)
.setContentText("click to open the file")
.setLights(0xfff89829, 300, 5000)
.setOnlyAlertOnce(true)
.setSound(uri)
.setSmallIcon(android.R.drawable.ic_input_add);
mNotifyManager.notify( NOTIFICATION_ID , mBuilder.build());