Skip to content

Commit

Permalink
Fix file sharing, fix #772
Browse files Browse the repository at this point in the history
  • Loading branch information
charlag committed Nov 12, 2018
1 parent d0f958d commit 12ce5b3
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.provider.Settings;
Expand All @@ -36,14 +35,12 @@
import android.widget.Toast;

import org.jdeferred.Deferred;
import org.jdeferred.DoneCallback;
import org.jdeferred.Promise;
import org.jdeferred.impl.DeferredObject;
import org.json.JSONArray;
import org.json.JSONException;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -372,12 +369,11 @@ void share(Intent intent) {

@NonNull
private JSONArray getFilesFromIntent(@NonNull Intent intent) {
Debug.waitForDebugger();
ClipData clipData = intent.getClipData();
final JSONArray filesArray = new JSONArray();
if (clipData != null) {
for (int i = 0; i < clipData.getItemCount(); i++) {
ClipData.Item item = clipData.getItemAt(0);
ClipData.Item item = clipData.getItemAt(i);
filesArray.put(item.getUri().toString());
}
} else {
Expand Down

0 comments on commit 12ce5b3

Please sign in to comment.