You can do this by
Intent intent = new Intent(Intent.ACTION_VIEW,ImageUri);
ImageUri = "content://media/external/images/media/1210"`
Call this intent in pendingIntent
PendingIntent contentIntent =
PendingIntent.getActivity(context.getApplicationContext(),
id,
intent,
PendingIntent.FLAG_ONE_SHOT
);
The above Imageuri is for representation. This worked for me after
several tries with other options. This intent doesnot work if you supply
file.getpath
or file.getabsolutepath
I've tried using Uri.fromFile
and it worked:
intent = new Intent(Intent.ACTION_VIEW,Uri.fromFile(fileName));