android 融云 集成遇到的问题集锦
2015-06-05 18:26
375 查看
遇到的问题:
1 获取群组和用户的信息时,数据不能从服务器获取。一定要从本地。否则会报错。
我们采取的解决方案是刚开始从服务器获取所有自己的好友或者群组信息。保证这部分数据可以正常显示。
所有不是好友的人的信息,则在请求是通过异步请求存到本地。保证下一次调用的时候可以正常显示
2 更改融云2.0头像的形状为圆或者方形
3 群组功能@功能实现
需要注意的是,
checkTextInputEditTextChanged()
这个函数不能调用多次,否则会有崩溃异常。。。当时我遇到的这个问题束手无策,是亲自杀到融云公司,,找他们的工程师当面解决才发现问题的。。。。汗。。。
4 屏蔽某个特定的对话消息
首先开启设置界面的时候需要传递特殊的参数过去:
Intent mIntent = new Intent(ConversationActivity.this,
IMMineFriendsMemberActivity.class);
Uri uri2 = Uri.parse("demo://" + getApplicationInfo().packageName)
.buildUpon().appendPath("conversationSetting")
.appendPath(ConversationType.GROUP + "")
.appendQueryParameter("targetId", targetId).build();
mIntent.setData(uri2);
否则会崩溃。
跳转到你自定义的activity,里面只需要在xml中包含特定的fragment就可以实现此效果,该fragment,imkit 中已经集成。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/de_fr_set_conver"
android:name="io.rong.imkit.fragment.SetConversationNotificationFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
1 获取群组和用户的信息时,数据不能从服务器获取。一定要从本地。否则会报错。
我们采取的解决方案是刚开始从服务器获取所有自己的好友或者群组信息。保证这部分数据可以正常显示。
所有不是好友的人的信息,则在请求是通过异步请求存到本地。保证下一次调用的时候可以正常显示
2 更改融云2.0头像的形状为圆或者方形
2.0头像形状修改: rc_item_conversation.xml 会话列表 rc_item_message.xml 会话页面 rc_item_conversation_member.xml 设置页面 app:shape=“circle” //圆形 app:shape=“square”//方形 每个xml文件中有两处需替换
3 群组功能@功能实现
@Override public boolean onUserPortraitLongClick(Context context, ConversationType type, UserInfo userinfo) { Log.d("family", "userInfo ===== " + userinfo.getName()); String name = userinfo.getName(); String contentText = textContent + "@" + name; TextInputProvider textInputProvider = (TextInputProvider) RongContext .getInstance().getPrimaryInputProvider(); // 重置文本框数据 textInputProvider.setEditTextContent(contentText); // return false; }
需要注意的是,
checkTextInputEditTextChanged()
这个函数不能调用多次,否则会有崩溃异常。。。当时我遇到的这个问题束手无策,是亲自杀到融云公司,,找他们的工程师当面解决才发现问题的。。。。汗。。。
4 屏蔽某个特定的对话消息
首先开启设置界面的时候需要传递特殊的参数过去:
Intent mIntent = new Intent(ConversationActivity.this,
IMMineFriendsMemberActivity.class);
Uri uri2 = Uri.parse("demo://" + getApplicationInfo().packageName)
.buildUpon().appendPath("conversationSetting")
.appendPath(ConversationType.GROUP + "")
.appendQueryParameter("targetId", targetId).build();
mIntent.setData(uri2);
否则会崩溃。
跳转到你自定义的activity,里面只需要在xml中包含特定的fragment就可以实现此效果,该fragment,imkit 中已经集成。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/de_fr_set_conver"
android:name="io.rong.imkit.fragment.SetConversationNotificationFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
相关文章推荐
- android 之EditText输入检测
- android 里的receiver 就像一个实时监控 总线数据,或者消息(intent)队列的东西,回调函数类似
- Android与IOS异同点对比(1)------ 显示
- Android Studio打包.so文件教程
- Android IOC框架
- Android基础系列-----------Intent简析
- Android加载Html的方法
- Android-Service中执行新线程的几种方式
- Android自定义控件
- AndroidManifest.xml中android:configChanges的简介
- Android开发的四大组件
- Android开源项目分类汇总
- [Android源码]Handler分析
- 玩转Android Camera开发(四):预览界面四周暗中间亮,只拍摄矩形区域图片(附完整源码)
- android经典开源代码分享
- 玩转Android Camera开发(三):国内首发---使用GLSurfaceView预览Camera 基础拍照demo
- 玩转Android Camera开发(一):Surfaceview预览Camera,基础拍照功能完整demo
- 玩转Android Camera开发(二):使用TextureView和SurfaceTexture预览Camera 基础拍照demo
- Android自定义动态布局 — 多图片上传
- 实现图文混排ListView展示 ---- Android版