注册

群详情获取失败

在确保登录成功的情况下,并且初始化完成,可以进行群创建和聊天的情况下
 
调用群详情获取
//根据群聊ID从服务器获取群聊信息
EMGroup group =EMGroupManager.getInstance().getGroupFromServer(grounId);
这个代码走之后直接进去了异常,
EaseMobException的描述是
com.easemob.exceptions.EaseMobException: android.os.NetworkOnMainThreadException
打印的堆栈消息:
07-04 07:42:34.087: W/System.err(7386): com.easemob.exceptions.EaseMobException: android.os.NetworkOnMainThreadException
07-04 07:42:34.097: W/System.err(7386):     at com.easemob.cloud.HttpClientManager.sendRequestWithCountDown(Unknown Source)
07-04 07:42:34.107: W/System.err(7386):     at com.easemob.cloud.HttpClientManager.sendRequest(Unknown Source)
07-04 07:42:34.107: W/System.err(7386):     at com.easemob.cloud.HttpClientManager.sendHttpRequestWithRetryToken(Unknown Source)
07-04 07:42:34.117: W/System.err(7386):     at com.easemob.cloud.HttpClientManager.sendRequestWithToken(Unknown Source)
07-04 07:42:34.127: W/System.err(7386):     at com.easemob.cloud.EMHttpClient.sendRequestWithToken(Unknown Source)
07-04 07:42:34.137: W/System.err(7386):     at com.easemob.chat.EMGroupManager.getGroupFromRestServer(Unknown Source)
07-04 07:42:34.137: W/System.err(7386):     at com.easemob.chat.EMGroupManager.getGroupFromServer(Unknown Source)
07-04 07:42:34.137: W/System.err(7386):     at com.tomatotown.util.InitIM.getPublicGroupInfo(InitIM.java:324)
07-04 07:42:34.137: W/System.err(7386):     at com.tomatotown.parent.activity.friends.GroupInfoActivity.getGroupInfo(GroupInfoActivity.java:246)
07-04 07:42:34.137: W/System.err(7386):     at com.tomatotown.parent.activity.friends.GroupInfoActivity.onCreate(GroupInfoActivity.java:67)
07-04 07:42:34.137: W/System.err(7386):     at android.app.Activity.performCreate(Activity.java:5231)
07-04 07:42:34.137: W/System.err(7386):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-04 07:42:34.137: W/System.err(7386):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227)
07-04 07:42:34.147: W/System.err(7386):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)
07-04 07:42:34.147: W/System.err(7386):     at android.app.ActivityThread.access$800(ActivityThread.java:147)
07-04 07:42:34.147: W/System.err(7386):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1226)
07-04 07:42:34.147: W/System.err(7386):     at android.os.Handler.dispatchMessage(Handler.java:102)
07-04 07:42:34.147: W/System.err(7386):     at android.os.Looper.loop(Looper.java:136)
07-04 07:42:34.147: W/System.err(7386):     at android.app.ActivityThread.main(ActivityThread.java:5137)
07-04 07:42:34.147: W/System.err(7386):     at java.lang.reflect.Method.invokeNative(Native Method)
07-04 07:42:34.147: W/System.err(7386):     at java.lang.reflect.Method.invoke(Method.java:515)
07-04 07:42:34.147: W/System.err(7386):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:801)
07-04 07:42:34.147: W/System.err(7386):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:617)
07-04 07:42:34.147: W/System.err(7386):     at dalvik.system.NativeStart.main(Native Method)
 
 
 
求助!!
 
 
已邀请:

xz

赞同来自: fat1

已经解决,多谢客服1008
原因:
在主线程中执行的原因,改为子线程就OK了。

要回复问题请先登录注册