Share action on a file

Post your questions and help other users.

Moderator: Martin

Post Reply
maxxyypoo
Posts: 23
Joined: 28 Jan 2015 08:47

Share action on a file

Post by maxxyypoo » 12 Jan 2016 09:28

So how do I do an action on a file that would be to open share/send menu? Like if you are in any file manager app and you select a file and click share button then share menu appears where you can send it to some other app or whatever. What I want to do is to watch a directory for a new file creation and when it is created I want to have a notification in notifcation tray and one of the actions would be to share that file that has been created and I want it to open that share menu and click whatever I want to share that file to. I know how to do everything but opening that share menu with the just newly created file as a query for the share menu. Any help?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Share action on a file

Post by Martin » 12 Jan 2016 14:40

Hi,

You can use the action Start Activity to do this. The example Compose Mail with Attachment available when editing the action should work. You can remove the subject, text and the mail addresses in the extra fields and just keep the STREAM. You have to create an uri from your file, prepending file:// to the absolute file path should work in most cases.

Regards,
Martin

Post Reply