Compressor
Compressor copied to clipboard
support for uri
Duplicated. #149
@jeziellago #149 has been closed. Could you please review this one?
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(...)
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. https://github.com/zetbaitsu/Compressor/issues/163#issuecomment-755061994