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 ) { if ( null == m_chatMsg ) {
m_chatMsg = new EditText( this ); m_chatMsg = new EditText( this );
} }
dialog = new AlertDialog.Builder( this ) lstnr = new DialogInterface.OnClickListener() {
.setMessage( R.string.compose_chat )
.setPositiveButton(R.string.button_send,
new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dlg, public void onClick( DialogInterface dlg,
int item ) { int item ) {
m_jniThread.handle( JNICmd.CMD_SENDCHAT, String msg = m_chatMsg.getText().toString();
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, lstnr )
.setNegativeButton( R.string.button_cancel, null ) .setNegativeButton( R.string.button_cancel, null )
.setView( m_chatMsg ) .setView( m_chatMsg )
.create(); .create();