mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
deal with null socket (e.g. if in airplane mode); deal with new public
rooms format.
This commit is contained in:
parent
1621e5932a
commit
5c958eaadb
1 changed files with 30 additions and 28 deletions
|
@ -70,7 +70,7 @@ public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
|
|||
|
||||
try {
|
||||
Socket socket = NetUtils.MakeProxySocket( m_context, 15000 );
|
||||
|
||||
if ( null != socket ) {
|
||||
DataOutputStream outStream =
|
||||
new DataOutputStream( socket.getOutputStream() );
|
||||
|
||||
|
@ -101,9 +101,11 @@ public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
|
|||
}
|
||||
String name = new String( bytes, lastIndex, index - lastIndex );
|
||||
Utils.logf( "got public room name: %s", name );
|
||||
int indx = name.lastIndexOf("/");
|
||||
int indx = name.lastIndexOf( "/" );
|
||||
indx = name.lastIndexOf( "/", indx-1 );
|
||||
names.add( name.substring(0, indx ) );
|
||||
}
|
||||
}
|
||||
} catch ( java.io.IOException ioe ) {
|
||||
Utils.logf( "%s", ioe.toString() );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue