HuanTanSheng / EasyPhotos

兼容android11、android 10,相机拍照,相册选择(单选/多选),文件夹图片选择(单选/多选),视频选择,视频图片多类型复杂选择,各界面根据状态栏颜色智能适配状态栏字体颜色变色为深色或浅色,根据使用场景智能适配沉浸式状态栏,内部处理运行时权限,支持Glide/Picasso/Imageloader等所有图片加载框架库的带默认勾选选中图片的能填充自定义广告的自定义Ui相机相册图片浏览选择器;更有拼图/文字贴纸/贴图/图片缩放/Bitmap图片添加水印/媒体文件更新到媒体库等众多Bitmap图片编辑功能的android Bitmap图片处理工具框架库。
3k stars 504 forks source link

java.lang.SecurityException: UID 10274 does not have permission to content://media/external/video/media/293361 [user 0] #248

Open panyiyiyi opened 1 year ago

panyiyiyi commented 1 year ago

java.lang.SecurityException: UID 10274 does not have permission to content://media/external/video/media/293361 [user 0] at android.os.Parcel.createExceptionOrNull(Parcel.java:2425) at android.os.Parcel.createException(Parcel.java:2409) at android.os.Parcel.readException(Parcel.java:2392) at android.os.Parcel.readException(Parcel.java:2334) at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2670) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1743) at android.app.Activity.startActivityForResult(Activity.java:5533) at androidx.activity.ComponentActivity.startActivityForResult(Unknown Source:0) at android.app.Activity.startActivityForResult(Activity.java:5486) at androidx.activity.ComponentActivity.startActivityForResult(Unknown Source:0) at android.app.Activity.startActivity(Activity.java:5892) at android.app.Activity.startActivity(Activity.java:5845) at com.huantansheng.easyphotos.ui.adapter.PreviewPhotosAdapter$1.onClick(Unknown Source:55) at android.view.View.performClick(View.java:7753) at android.view.View.performClickInternal(View.java:7730) at android.view.View.access$3700(View.java:861) at android.view.View$PerformClick.run(View.java:29146) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8293) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)

EgbertYuan commented 1 year ago

我也遇到这个问题,运行demo的时候,选择视频,然后点击预览播放,就会报这个错,是必现的,是权限问题吧?

shunFSKi commented 1 year ago

https://github.com/HuanTanSheng/EasyPhotos/issues/219#issuecomment-1042662608

private void toPlayVideo(View v, Uri uri, String type) { Context context = v.getContext(); Intent intent = new Intent(Intent.ACTION_VIEW); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.putExtra(Intent.EXTRA_STREAM, uri); } intent.setDataAndType(uri, type); context.startActivity(intent); }