Question : add Duration to date in Kotlin
Answered by : funyinoluwa-kashimawo
Date.time.plus(Duration.ofDays(1).toMillis())
Source : https://funyinkash.com | Last Update : Fri, 10 Jun 22
Question : how to get time duration from file kotlin
Answered by : amir-je
// for android 10+
val uri = Uri.parse("full/path/to/file\ or /link/to/internet/resource")
var durationTime: Long
MediaPlayer.create(this, uri).also { durationTime = (it.duration / 1000).toLong() it.reset() it.release()
}
Source : | Last Update : Sat, 21 Nov 20