connection.isSmEnabled()
总是返回假。
下面是代码
config=XMPPTCPConnectionConfiguration
.builder()
.setHost("host")
.setPort(5222)
.setServiceName("localhost")
.setSecurityMode(SecurityMode.disabled)
.setDebuggerEnabled(true)
.build();
connection=new XMPPTCPConnection(config);
XMPPTCPConnection.setUseStreamManagementDefault(true);
send.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v)
{
connection.setUseStreamManagement(true);
Toast.makeText(getApplicationContext(), String.valueOf(connection.isSmEnabled()), Toast.LENGTH_SHORT).show();
connectionss con=new connectionss();
con.execute();
//Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
//startActivityForResult(i, 1);
}
} );
请帮忙。我正在尝试在 android 中测试 smack 4.1。