|
//发送结束会诊的透传消息
private void sendCloseCommand() {
byte[] endTokenBytes = null;
try {
endTokenBytes = "close".getBytes("utf-8");
mAnychatSDK.TransBuffer(-1, endTokenBytes, endTokenBytes.length);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
// 收到透明通道数据事件
@Override
public void OnAnyChatTransBuffer(int dwUserid, byte[] lpBuf, int dwLen) {
Log.d("OnAnyChatTransBuffer", "OnAnyChatTransBuffer");
try {
String str = new String(lpBuf, 0, dwLen, "utf-8");
if ("close".equals(str)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(false);
builder.setTitle(R.string.title_dlg_finish_consu).setMessage(R.string.text_dlg_finish_consu)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
}).show();
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}发送是可以的,例如别人关闭了视频,我收不到这个响应,mAnychatSDK.SetTransDataEvent(this);也写了
|
|