Private an OnClickListener SendClickListenerClient=new an OnClickListener () {
@ Override
Public void onClick (View arg0) {
HandPaint. Dump ();
//Byte b0=0;
If (isConnecting & amp; & MySocket!=null)
{
String msgText=HandPaint. GetPoints (). The toString () + END;//in the edit box, we input the content of the
If (msgText. Length () & lt;=0)
{
Toast. MakeText (mContext, "send content cannot be empty!" , Toast.LENGTH_SHORT).show();
}
The else
{
Try
{
Out. Write (GetStringLength (msgText length () + 1));
Out. Write (msgText getBytes ());
//the out. Write (b0);//
//the out. Write (short2byte (0));
out.flush();
}
The catch (Exception e)
{
//TODO: handle the exception
Toast. MakeText (mContext, "send exception:" + um participant etMessage (), Toast. LENGTH_SHORT), show ();
}
}
}
CodePudding user response:
Your problem solved now