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