小编hoh*_*ins的帖子

Android 7 nougat,如何从传入意图的uri获取文件路径?

FileProvider: - 设置文件共享

我知道在android nougat中更改文件策略.文件共享到其他应用程序的通缉应用程序通过FileProvider生成uri.uri格式是content://com.example.myapp.fileprovider/myimages/default_image.jpg.

我想知道如何从生成的uri获取filepath FileProvider.getUriForFile().因为我的app需要知道物理文件路径才能保存,加载,读取信息等,这是可能的

[简而言之]

  1. 我的应用程序在andorid 7 nougat上收到了其他应用程序的意图uri.
  2. uri格式是 content://com.example.myapp.fileprovider/myimages/default_image.jpg
  3. 也许是由它产生的FileProvider.getUriForFile.
  4. 我想知道从uri获取文件路径的方法.
  5. 我可以从中获取mime类型,显示名称,文件大小和读取binay getContentResolver().openFileDescriptor().但我想知道文件路径.

android filepath android-intent android-fileprovider android-7.0-nougat

5
推荐指数
1
解决办法
5899
查看次数