Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for uri #150

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

support for uri #150

wants to merge 4 commits into from

Conversation

shrastiRisor
Copy link

No description provided.

@jeziellago
Copy link

Duplicated. #149

@shrastiRisor
Copy link
Author

@jeziellago #149 has been closed. Could you please review this one?

@hikkidev
Copy link

hikkidev commented Sep 29, 2020

It is required to add a check for an existing file, if it was created by your app locally and is not registered with resolver.
(Got NPE cursor is null)

fun getFileName(context: Context, uri: Uri): String {
    uri.path?.let {
        val file = File(it)
        if (file.exists()) return file.name
    }

    val resolver = context.contentResolver
    val cursor = resolver.query(...)

@extorn
Copy link

extorn commented Jan 6, 2021

Perhaps the code that I posted can be used to resolve the issues here and get it working. I use my code to compress any files on Android 10. #163 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants