|
@@ -67,10 +67,7 @@ class WebviewManager {
|
|
|
} else if (videoUri != null && getFileSize(videoUri) > 0) {
|
|
} else if (videoUri != null && getFileSize(videoUri) > 0) {
|
|
|
results = new Uri[] { videoUri };
|
|
results = new Uri[] { videoUri };
|
|
|
} else if (intent != null) {
|
|
} else if (intent != null) {
|
|
|
- String dataString = intent.getDataString();
|
|
|
|
|
- if(dataString != null){
|
|
|
|
|
- results = new Uri[]{ Uri.parse(dataString) };
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ results = getSelectedFiles(intent);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(mUploadMessageArray != null){
|
|
if(mUploadMessageArray != null){
|
|
@@ -96,6 +93,26 @@ class WebviewManager {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private Uri[] getSelectedFiles(Intent data) {
|
|
|
|
|
+ // we have one files selected
|
|
|
|
|
+ if (data.getData() != null) {
|
|
|
|
|
+ String dataString = data.getDataString();
|
|
|
|
|
+ if(dataString != null){
|
|
|
|
|
+ return new Uri[]{ Uri.parse(dataString) };
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // we have multiple files selected
|
|
|
|
|
+ if (data.getClipData() != null) {
|
|
|
|
|
+ final int numSelectedFiles = data.getClipData().getItemCount();
|
|
|
|
|
+ Uri[] result = new Uri[numSelectedFiles];
|
|
|
|
|
+ for (int i = 0; i < numSelectedFiles; i++) {
|
|
|
|
|
+ result[i] = data.getClipData().getItemAt(i).getUri();
|
|
|
|
|
+ }
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
boolean closed = false;
|
|
boolean closed = false;
|
|
|
WebView webView;
|
|
WebView webView;
|
|
|
Activity activity;
|
|
Activity activity;
|