0

I am downloading an image and saving it to a folder, and pushing a Notification, I want when user click on Notification, all the image from that folder in which image in saved should open in the android's default gallery view..below is my code snippet.

File file = new File(result);
if (file.exists()) {
    galleryAddPic(file);
// push a notification of image downloaded.     
    NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
    PendingIntent pIntent = PendingIntent.getActivity(context, 0, intent, 0);

    Notification notification = new Notification.Builder(context).setContentTitle("Download Complete").setContentText("Image downloaded, click to see.").setSmallIcon(R.drawable.arrow).setContentIntent(pIntent).setAutoCancel(true).getNotification();
    notificationManager.notify(0, notification);
}
Jonathan Eustace
  • 2,469
  • 12
  • 31
  • 54
umesh
  • 1,148
  • 1
  • 12
  • 25
  • With `wan't` you mean: `i don't want to` or `i want to`? Seems like `Wan't` is used in old english style, lol. – Marco Acierno Jan 06 '14 at 13:58
  • @umesh, Please refer this link it will help you.1.Open Gallery Folder By Click On Notification http://stackoverflow.com/questions/21486415/open-gallery-folder-by-click-on-notification 2. Open an image using URI in Android's default gallery image viwer http://stackoverflow.com/questions/5383797/open-an-image-using-uri-in-androids-default-gallery-image-viwer – Sandeep Devhare Mar 15 '16 at 05:41

0 Answers0