Giter VIP home page Giter VIP logo

Comments (4)

qingmei2 avatar qingmei2 commented on July 29, 2024

@feimenggo

机型的原因,可能是设备本身没有提供 android本身系统级别相册 的这个Activity,在onError()中处理即可。

from rximagepicker.

feimenggo avatar feimenggo commented on July 29, 2024

嗯,谢谢

from rximagepicker.

jhchee avatar jhchee commented on July 29, 2024

@feimenggo

机型的原因,可能是设备本身没有提供 android本身系统级别相册 的这个Activity,在onError()中处理即可。

請問此問題該怎麼解決?

from rximagepicker.

jhchee avatar jhchee commented on July 29, 2024

@qingmei2
是否可用如下方法來處理該問題

在次行修改code

            val getIntent = Intent(Intent.ACTION_GET_CONTENT)
            val pickIntent = Intent(Intent.ACTION_PICK)
                .addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
            val chooserIntent = Intent.createChooser(getIntent, "Select Image")
            chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, arrayOf(pickIntent))
            chooserIntent.apply {
                putExtra(Intent.EXTRA_LOCAL_ONLY, true)
                addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
                type = getMimesType()
            }
            return chooserIntent

參考https://stackoverflow.com/a/45707761/7068460

from rximagepicker.

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.