mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
don't send 0-length message
This commit is contained in:
parent
0148a93f3e
commit
c039b92339
1 changed files with 11 additions and 8 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue