|
|
@@ -37,7 +37,7 @@ public class WifiCommunication { |
|
|
|
} catch (SocketException | UnknownHostException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText("Communication running")); |
|
|
|
//mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText("Communication running")); |
|
|
|
} |
|
|
|
private class ReceiveThread extends Thread { |
|
|
|
private StringBuffer rxStringBuffer = new StringBuffer(); |
|
|
@@ -58,7 +58,7 @@ public class WifiCommunication { |
|
|
|
rxString = new String(rxPacket.getData()); |
|
|
|
if(!previousRxString.equals(rxString)) { |
|
|
|
rxStringBuffer.append(rxString).append("\n"); |
|
|
|
mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText(rxStringBuffer)); |
|
|
|
//mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText(rxStringBuffer)); |
|
|
|
previousRxString = rxString; |
|
|
|
} |
|
|
|
|