如何从文件路径获取图像 Uri?

问题描述

首先请原谅我的英语不好。当我手动选择图片时我的改造工作。但是当我通过文件路径上传图像时,我的应用程序强制关闭

我的文件位置 = storage/emulatrd/0/myImage.jpg

File file = new File(Environment.getExternalStorageDirectory().toString() + "/bb.jpg");
        
        Uri uri = Uri.fromFile(file);  // when i use this uri my app crashed

        Uri selectedImage = data.getData(); // this uri good worked

        uploadFile(uri,"My Image");

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)