From fc20a31b6c6db68a019930ea90b5d828ed55e224 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Sun, 18 Jan 2015 16:32:12 -0500 Subject: [PATCH] if there are multiple interfaces up, go ahead and list them all --- res/layout/main.xml | 2 -- src/org/galexander/sshd/SimpleSSHD.java | 10 +++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/res/layout/main.xml b/res/layout/main.xml index 535657b..9f499d3 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -8,9 +8,7 @@ android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:typeface="monospace" - android:singleLine="true" android:background="#ff112266" - android:scrollHorizontally="true" android:text="IP: XXX" /> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface intf : interfaces) { @@ -178,11 +179,14 @@ public class SimpleSSHD extends Activity if (i != -1) { ip = ip.substring(0,i); } - return ip; + if (!ret.equals("")) { + ret += "\n"; + } + ret += "IP: "+ ip; } } } } catch (Exception ex) { } // for now eat exceptions - return ""; + return ret; } }