当前位置: 首页 > news >正文

Android Uri转File path路径,Kotlin

Android Uri转File path路径,Kotlin

    /*** URI转化为file path路径*/private fun getFilePathFromURI(context: Context, contentURI: Uri): String? {val result: String?var cursor: Cursor? = nulltry {cursor = context.contentResolver.query(contentURI, null, null, null, null)} catch (e: Exception) {e.printStackTrace()}if (cursor == null) {result = contentURI.path} else {cursor.moveToFirst()val idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA)result = cursor.getString(idx)cursor.close()}return result}

Android 13手机图片存储File路径转Uri,Java_android file 转uri-CSDN博客文章浏览阅读682次。android根据图片资源的drawable id转化为Uri,java_zhangphil的博客-CSDN博客。android根据图片资源的drawable id转化为Uri的工具方法。Android 13手机图片存储File路径转Uri,Java。_android file 转urihttps://blog.csdn.net/zhangphil/article/details/129640812android根据图片资源的drawable id转化为Uri,java_android drawable 转uri-CSDN博客文章浏览阅读649次。android根据图片资源的drawable id转化为Uri的工具方法。_android drawable 转urihttps://blog.csdn.net/zhangphil/article/details/129431755

Android4.4以上版本Uri content转换成File文件路径_android content 转 file-CSDN博客文章浏览阅读4.4k次,点赞2次,收藏8次。public static String getFilePathByUri(Context context, Uri uri) { String path = null; // 以 file:// 开头的 if (ContentResolver.SCHEME_FILE.equals(uri.getScheme())) { ..._android content 转 filehttps://blog.csdn.net/zhangphil/article/details/87859320

http://www.lryc.cn/news/371017.html

相关文章:

  • iOS界面设计要点:四大模块解析
  • 数字取证技术(Digital Forensics Technology)实验课II
  • Redis缓存的使用
  • 力扣LCP 08.剧情触发时间
  • Elasticsearch-IndexTemplate和DynamicTemplate 有什么区别
  • list集合自定义排序
  • PHP Cookies:应用与管理
  • 【GD32F303红枫派使用手册】第十四节 DAC-输出电压实验
  • java 使用Log4j进行日志记录
  • 【问题解决】adb remount 失败或刷机无法连接设备(KaiOS)
  • 为什么电容两端电压不能突变
  • Redux 与 MVI:Android 应用的对比
  • 《MySQL是怎样运行的》读书笔记(三) B+树索引
  • 微信小程序基础工作模板
  • 简单说一下STL中的map容器的特点、底层实现和应用场景【面试】
  • Ubuntu22.04之有道词典无法画词翻译替代方案(二百四十九)
  • AnythingLLM 的 Docker 使用
  • 数组还可以这样用!常用但不为人知的应用场景
  • C++模板元编程:编译时的魔法
  • SQL进阶day10————多表查询
  • debug调试_以Pycharm为例
  • wms第三方海外仓系统:如何为中小型海外仓注入新活力
  • html是什么?http是什么?
  • L1-007 念数字js实现
  • Perl 运算符
  • 语法04 C++ 标准输入语句
  • python数据分析--- ch6-7 python容器类型的数据及字符串
  • 【Linux取经路】守护进程
  • Nginx之文件下载服务器
  • OpenCV学习(4.11) OpenCV中的图像转换