i have an image Uri File and i need to check if that file is larger than 1mb. here is a piece of what i tried:
val uriFile = selectedPhotoUri!!.toFile()
uriFileLength = (uriFile.length().div(1024))
application crashed
also I've tried that:
val uriFile :File = File(selectedPhotoUri.toString())
uriFileLength = (uriFile1.length().div(1024))
uriFileLength
always returns as 0
also i am using Kotlin, I searched on this forum but only found java codes.
thanks in advance.