From 3b41752382464d0d8643a50d8151e58690198a3c Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 3 Feb 2015 22:23:11 -0800 Subject: [PATCH] show no conn options as a localizable, non-empty string rather than empty string --- .../org/eehouse/android/xw4/jni/CommsAddrRec.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java index 6ffbb4273..2263b1542 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/CommsAddrRec.java @@ -84,12 +84,18 @@ public class CommsAddrRec { public String toString( Context context ) { + String result; CommsConnType[] types = getTypes(); - String[] strs = new String[types.length]; - for ( int ii = 0; ii < types.length; ++ii ) { - strs[ii] = types[ii].longName( context ); + if ( 0 == types.length ) { + result = LocUtils.getString( context, R.string.note_none ); + } else { + String[] strs = new String[types.length]; + for ( int ii = 0; ii < types.length; ++ii ) { + strs[ii] = types[ii].longName( context ); + } + result = TextUtils.join( " + ", strs ); } - return TextUtils.join( " + ", strs ); + return result; } private static final CommsConnType[] s_hint = new CommsConnType[0];