以下代码是在onResume中编写的,并且正在实现SendBird API的接收消息功能
protected void onResume()
{
super.onResume();
Log.d("----->", "in on resume");
SendBird.addChannelHandler("ABCD" , new SendBird.ChannelHandler()
{
@Override
public void onMessageReceived(BaseChannel baseChannel, BaseMessage
baseMessage)
{
Log.d("----->","onMessageReceived");
if (baseMessage instanceof UserMessage)
{
// message is a UserMessage
UserMessage userMessage = (UserMessage) baseMessage;
String msg = userMessage.getMessage();
alMsgs.add(msg);
adapter.notifyDataSetChanged();
Log.d("---->",msg);
}
else if (baseMessage instanceof FileMessage)
{
// message is a FileMessage
}
}
@Override
public void onChannelDeleted(String channelUrl,
BaseChannel.ChannelType channelType)
{
super.onChannelDeleted(channelUrl, channelType);
Log.d("---->","on channel deleted");
}
});
}
我没有在Android监视器中获得任何日志输出,除了在简历中说" in#34;。