CodenameOne
CodenameOne copied to clipboard
Add a Feature to Share Multiple Files
Display.getInstance().share(filePath, null, mimeType);
Successfully shares single files.
Executing the share function in a loop to share 3 different files with different mime types like plain/text, image/jpeg, application/pdf Eg.
for(int f = 0; f < array.length(); f++) {
JSONObject object = array.getJSONObject(f);
String filePath = object.getString("Path");
String mimeType = object.getString("MimeType");
Display.getInstance().share(filePath, null, mimeType);
}
Successfully shares all files. But the problem is that the Share Sheet in the device shows 3 times. That is, after sharing 1st file, 2nd Sheet shows to share 2nd file. After sharing 2nd file, 3rd share Sheet shows to share 3rd file.
How can all files be shared via 1 Share Sheet?
Discussion
https://www.reddit.com/r/cn1/comments/1ecuaok/how_can_share_api_share_multiple_files/