Skip to content

Commit b453901

Browse files
authored
Merge pull request #206 from spoonconsulting/cdv-thread-pool
Revert to using getThreadPool
2 parents 621965b + 9f01543 commit b453901

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/android/FileTransferBackground.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ private void sendError(final String id, final String reason, boolean userCancele
121121

122122
@Override
123123
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) {
124-
if(executorService == null) {
124+
if (executorService == null) {
125125
executorService = Executors.newScheduledThreadPool(4);
126126
}
127127

128-
executorService.schedule(() -> {
128+
cordova.getThreadPool().execute(() -> {
129129
try {
130130
switch (action) {
131131
case "initManager":
@@ -151,7 +151,7 @@ public boolean execute(String action, JSONArray args, final CallbackContext call
151151
callbackContext.sendPluginResult(result);
152152
exception.printStackTrace();
153153
}
154-
} , 0, TimeUnit.MILLISECONDS);
154+
});
155155

156156
return true;
157157
}

0 commit comments

Comments
 (0)