Giter Site home page Giter Site logo

UriUtils.java about devutils HOT 4 CLOSED

afkt avatar afkt commented on May 10, 2024
UriUtils.java

from devutils.

Comments (4)

afkT avatar afkT commented on May 10, 2024

尝试 Android Q DEBUG 暂时没出现这个情况,你是调用 UriUtils.getFilePathByUri 出现的?

实际是因为 Android Q Scoped Storage 限制导致,链接内的代码操作是,通过判断大于 Android Q 则直接把 Uri 文件复制到 getExternalCacheDir 中,并且返回该文件路径,这种和这个方法功能有歧义,我可以加一个新方法,专门用于把 Uri 复制到 Cahce 中并返回复制后的路径信息

from devutils.

JiZhi-Error avatar JiZhi-Error commented on May 10, 2024

尝试 Android Q DEBUG 暂时没出现这个情况,你是调用 UriUtils.getFilePathByUri 出现的?

实际是因为 Android Q Scoped Storage 限制导致,链接内的代码操作是,通过判断大于 Android Q 则直接把 Uri 文件复制到 getExternalCacheDir 中,并且返回该文件路径,这种和这个方法功能有歧义,我可以加一个新方法,专门用于把 Uri 复制到 Cahce 中并返回复制后的路径信息

我目前就是这么干的,魔改了你的工具类
判断是否大于Q
我在我手机上这个问题是必现得:一加7P Android Q

from devutils.

JiZhi-Error avatar JiZhi-Error commented on May 10, 2024

尝试 Android Q DEBUG 暂时没出现这个情况,你是调用 UriUtils.getFilePathByUri 出现的?
实际是因为 Android Q Scoped Storage 限制导致,链接内的代码操作是,通过判断大于 Android Q 则直接把 Uri 文件复制到 getExternalCacheDir 中,并且返回该文件路径,这种和这个方法功能有歧义,我可以加一个新方法,专门用于把 Uri 复制到 Cahce 中并返回复制后的路径信息

我目前就是这么干的,魔改了你的工具类
判断是否大于Q
我在我手机上这个问题是必现得:一加7P Android Q

image

from devutils.

afkT avatar afkT commented on May 10, 2024

已经修复了(DevAppX:1.9.9),你可以直接调用 UriUtils.getFilePathByUri(uri, true) 或者 UriUtils.copyByUri(uri)

from devutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.