don't send 0-length message

This commit is contained in:
Andy2 2010-11-03 18:26:20 -07:00
parent 0148a93f3e
commit c039b92339

View file

@ -233,16 +233,19 @@ public class BoardActivity extends XWActivity implements UtilCtxt {
if ( null == m_chatMsg ) {
m_chatMsg = new EditText( this );
}
lstnr = new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dlg,
int item ) {
String msg = m_chatMsg.getText().toString();
if ( msg.length() > 0 ) {
m_jniThread.handle( JNICmd.CMD_SENDCHAT, msg );
}
}
};
dialog = new AlertDialog.Builder( this )
.setMessage( R.string.compose_chat )
.setPositiveButton(R.string.button_send,
new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dlg,
int item ) {
m_jniThread.handle( JNICmd.CMD_SENDCHAT,
m_chatMsg.getText().toString() );
}
})
.setPositiveButton(R.string.button_send, lstnr )
.setNegativeButton( R.string.button_cancel, null )
.setView( m_chatMsg )
.create();