When pressed to notification, open the folder



  • Hello, I have a notification, and if I press him, I'd like the shuttle to open the folder but it's not happening.

        public void showNotification(boolean p) {
            Intent intent = new Intent();
            intent.setAction(android.content.Intent.ACTION_VIEW);
            intent.setData(Uri.fromFile(new File( Environment.getExternalStorageDirectory()+"/folder")));
             pi = PendingIntent.getActivity(this, 0, intent,0);
             r = getResources();
            notification = PutDatainsideNoti(p);
            notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
            notificationManager.notify(0, notification);
        }
    


  • Try it. Intent Here we go.

    pi = PendingIntent.getActivity(this, 0, new Intent(Environment.getExternalStorageDirectory()+)/Papka/), 0);

    On:

    Intent intent = new Intent();
    intent.setAction(android.content.Intent.ACTION_VIEW);
    File file = new File(Environment.getExternalStorageDirectory()+"/Папка/");
    intent.setData(Uri.fromFile(file));
    pi = PendingIntent.getActivity(this, 0, intent, 0);
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2