diff options
author | Artur Dryomov <artur.dryomov@gmail.com> | 2013-07-12 19:33:10 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-07-25 18:01:54 +0100 |
commit | 4397d863f475e70463972aa3fb1b90d108ebb6d8 (patch) | |
tree | f920ab13be6ea62943b5430dd477c5617d5ad49b /android | |
parent | Add additional loading servers to the UI. (diff) | |
download | core-4397d863f475e70463972aa3fb1b90d108ebb6d8.tar.gz core-4397d863f475e70463972aa3fb1b90d108ebb6d8.zip |
Change TcpServersFinder to handle multiple threads properly.
Change-Id: I6d76e1b25e5d3a38fef0d3702fdb35a11e129946
Diffstat (limited to 'android')
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java index f5c7492d6126..bf8f9506c4cb 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java @@ -46,10 +46,14 @@ public class TcpServersFinder implements ServersFinder, Runnable { mContext = aContext; mServers = new HashMap<String, Server>(); + + mSearchService = Executors.newSingleThreadScheduledExecutor(); } @Override public void startSearch() { + stopSearch(); + mSearchService = Executors.newSingleThreadScheduledExecutor(); mSearchService.scheduleAtFixedRate(this, 0, SEARCH_DELAY_IN_SECONDS, TimeUnit.SECONDS); } |