Display share is not attaching file but just giving filename

22 views
Skip to first unread message

workmob...@gmail.com

unread,
Apr 5, 2018, 10:58:38 AM4/5/18
to CodenameOne Discussions
Hi,

I trying to share my zip file for which I used Display.getInstance().share() method, the code I have written is as 

 String root= FileSystemStorage.getInstance().getAppHomePath();
 String out= root + textField.getText() + ".zip";
 
if(Display.getInstance().isNativeShareSupported()) {
Display.getInstance().share(out, null, "application/zip");
}

in this case the zip file isnot attaching, it just gives me filename or the file path. I want to attach the zip file which I created. How I can achieve this ? 

I am able to attach zip file with mail functionality, but I want to share so that user get free access to save that file.

Shai Almog

unread,
Apr 6, 2018, 1:28:14 AM4/6/18
to CodenameOne Discussions
Hi,
try passing the file path in the second argument as the image.

Workmobile Esay

unread,
Apr 6, 2018, 3:54:44 AM4/6/18
to codenameone...@googlegroups.com
Hi..

I tried to send the path but still its same like

Display.getInstance().share(out, root, "application/zip");  where String root=   FileSystemStorage.getInstance().getAppHomePath();

I get just the zip filename or some weird string. Am I doing something wrong here ?

On 6 April 2018 at 06:28, Shai Almog <shai....@gmail.com> wrote:
Hi,
try passing the file path in the second argument as the image.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/kl8ZdZrupxA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/278bce1e-1b76-4c8d-8761-5a7b7e507ad9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Shai Almog

unread,
Apr 7, 2018, 12:15:37 AM4/7/18
to CodenameOne Discussions
Hi,
don't pass the root. Pass the full path to the file you wrote in file system storage.
Reply all
Reply to author
Forward
0 new messages