Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/Plugins/SharePlugin/SendFileActivity.java
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 83 | for (int i = 0; i < clipdata.getItemCount(); i++) { | |||
---|---|---|---|---|---|
84 | uris.add(clipdata.getItemAt(i).getUri()); | 84 | uris.add(clipdata.getItemAt(i).getUri()); | ||
85 | } | 85 | } | ||
86 | } | 86 | } | ||
87 | } | 87 | } | ||
88 | 88 | | |||
89 | if (uris.isEmpty()) { | 89 | if (uris.isEmpty()) { | ||
90 | Log.w("SendFileActivity", "No files to send?"); | 90 | Log.w("SendFileActivity", "No files to send?"); | ||
91 | } else { | 91 | } else { | ||
92 | BackgroundService.RunCommand(this, new BackgroundService.InstanceCallback() { | 92 | BackgroundService.RunCommand(this, service -> { | ||
93 | @Override | | |||
94 | public void onServiceStart(BackgroundService service) { | | |||
95 | Device device = service.getDevice(mDeviceId); | 93 | Device device = service.getDevice(mDeviceId); | ||
96 | if (device == null) { | 94 | if (device == null) { | ||
97 | Log.e("SendFileActivity", "Device is null"); | 95 | Log.e("SendFileActivity", "Device is null"); | ||
98 | finish(); | 96 | finish(); | ||
99 | return; | 97 | return; | ||
100 | } | 98 | } | ||
101 | SharePlugin.queuedSendUriList(getApplicationContext(), device, uris); | 99 | SharePlugin.queuedSendUriList(getApplicationContext(), device, uris); | ||
102 | } | | |||
103 | }); | 100 | }); | ||
104 | } | 101 | } | ||
105 | } | 102 | } | ||
106 | finish(); | 103 | finish(); | ||
107 | break; | 104 | break; | ||
108 | default: | 105 | default: | ||
109 | super.onActivityResult(requestCode, resultCode, data); | 106 | super.onActivityResult(requestCode, resultCode, data); | ||
110 | } | 107 | } | ||
111 | } | 108 | } | ||
112 | 109 | | |||
113 | } | 110 | } |