android 环信采坑

android 环信采坑

1.图片查看大图的时候crash

解决方法:

<!-- 查看大图崩溃 之所有会崩溃是因为没有在清单文件(AndroidManifest.xml)中配置查看图片的Activity -->
<activity
    android:name="com.hyphenate.easeui.ui.EaseShowBigImageActivity"
    android:screenOrientation="portrait"
    android:theme="@style/horizontal_slide" />
<activity android:name=".ChatActivity"></activity>

2.拍照的时候报错: FileUriExposedException

解决方法如下:

在环信集成进行聊天页面拍照的时候,4.4的机子拍照正常,7.0的机子拍照就出现了问题:fileuriexposedexception

环信中的处理代码位于:EaseChatFragment类下的selectPicFromCamera方法中:


修改为:

cameraFile = new File(PathUtil.getInstance().getImagePath(), EMClient.getInstance().getCurrentUser()
        + System.currentTimeMillis() + ".jpg");
cameraFile.getParentFile().mkdirs();

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    ContentValues contentValues = new ContentValues(1);
    contentValues.put(MediaStore.Images.Media.DATA, cameraFile.getAbsolutePath());
    Uri uri = getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
    startActivityForResult(intent, REQUEST_CODE_CAMERA);

} else {
    startActivityForResult(
            new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
            REQUEST_CODE_CAMERA);
}

3.地图点击闪退

解决办法:

<!-- 百度地图所需的service -->
<service
    android:name="com.baidu.location.f"
    android:enabled="true"
    android:process=":remote" />

<meta-data
    android:name="com.baidu.lbsapi.API_KEY"
    android:value="3ecea51f560650b1ed8a4b99808f52e8" />
<!-- 地图 -->
<activity
    android:name="com.hyphenate.easeui.ui.EaseBaiduMapActivity"
    android:screenOrientation="portrait"
    android:theme="@style/horizontal_slide" />

4.android环信语音播放没有声音

解决办法

5.适配6.0

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值