diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-20 17:10:46 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2012-08-20 17:11:50 +0200 |
commit | 2e44e8134b077032341849886e2aad465cee1fd9 (patch) | |
tree | 989767d94fb0fdf7dbe5eea6c164fd07538a2bd0 | |
parent | 92aab43c80cac484b5db2467b35132c55792736d (diff) |
Fixed formatting of Network Servers in selection screen.
Change-Id: Ia2e0612588b1bad4971b73852f9cbededb233c7e
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java | 1 | ||||
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java index f6f9514de9af..267636fa606f 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java @@ -101,6 +101,7 @@ public class SelectorActivity extends Activity { void doUnbindService() { unbindService(mConnection); + mCommunicationService = null; } private ServiceConnection mConnection = new ServiceConnection() { diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java index c88d018bcabe..4734ff457e32 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java +++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java @@ -53,9 +53,10 @@ public class ServerFinder { if (i == aBuffer.length || !aCommand.equals("LOREMOTE_ADVERTISE")) { return; } - for (int j = i; j < aBuffer.length; j++) { - if (aPacket.getData()[i] == '\n') { - aName = new String(aPacket.getData(), i + 1, j, CHARSET); + for (int j = i + 1; j < aBuffer.length; j++) { + if (aPacket.getData()[j] == '\n') { + aName = new String(aPacket.getData(), i + 1, j - (i + 1), + CHARSET); break; } } @@ -66,6 +67,7 @@ public class ServerFinder { .getAddress().getHostAddress(), aName, System.currentTimeMillis()); mServerList.put(aServer.getAddress(), aServer); + System.out.println("Contains:<<" + aName + ">>"); Intent aIntent = new Intent( CommunicationService.MSG_SERVERLIST_CHANGED); |