我正在使用QuickBlox在我的聊天应用程序中发送图像。该场景是用户首先将图像上传到QuickBlox服务器然后将消息发送给其他用户。在发送消息我随机收到此错误有时它不会显示此错误:
java.lang.NullPointerException
at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:72)
at org.jivesoftware.smack.util.XmlStringBuilder.length(XmlStringBuilder.java:212)
at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:72)
at org.jivesoftware.smack.util.XmlStringBuilder.length(XmlStringBuilder.java:212)
at org.jivesoftware.smack.util.LazyStringBuilder.length(LazyStringBuilder.java:72)
at org.jivesoftware.smack.util.LazyStringBuilder.toString(LazyStringBuilder.java:100)
at org.jivesoftware.smack.util.XmlStringBuilder.toString(XmlStringBuilder.java:227)
at org.jivesoftware.smack.tcp.PacketWriter.writePackets(PacketWriter.java:163)
at org.jivesoftware.smack.tcp.PacketWriter.access$000(PacketWriter.java:40)
at org.jivesoftware.smack.tcp.PacketWriter$1.run(PacketWriter.java:77)
请帮忙。
答案 0 :(得分:0)
我现在不知道你是怎么做的,但QuickBlox团队推荐的方法是:
http://quickblox.com/developers/Android_XMPP_Chat_Sample#Send_and_receive_a_message_with_attachment
使用内容模块将文件附件存储在聊天
中