开发者

XMPP Android - Can't create MultiUserChat

I'm using asmack lastest version (now). And I can't create a MultiUserCha开发者_StackOverflow社区t on Android.

This is what I get in the log:

E/AndroidRuntime( 558): java.lang.ClassCastException: org.jivesoftware.smack.packet.DefaultPacketExtension E/AndroidRuntime( 558): at org.jivesoftware.smackx.muc.MultiUserChat.getMUCUserExtension(MultiUserChat.java:2000) E/AndroidRuntime( 558): at org.jivesoftware.smackx.muc.MultiUserChat.create(MultiUserChat.java:364) ....

Who can help me solve this bug? Thanks!


use muc.join(); directly insted of first using muc.create


Google is your friend, at least a quick search on the jive community forums.

I think that you have forgotten to register the Providers for XMPP Extensions. This gets normally done by smack via a config file, but this process is not possible on Android with asmack, so you need to do it explicitly.


when you want to create a MultiUserChat using smack, maybe you would come across some error! I suggested you to use asmack instead of smack on Android! you can get the asmack from github,https://github.com/flowdalic/asmack! you must make sure that you have red the README.md before you use it! when you want to call the api in every activity!you should call SmackAndroid.init(context) firstly! good luck!

besides that you much make sure that your room's name do not contain blank,when you want to create a multiuserchat or you maybe get odd errors!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜