Zlatko
03/22/2023, 1:32 PMfun ByteArray.toHex(): String =
joinToString(separator = "") { eachByte -> "%02x".format(eachByte) }
which works inside the mainactivity
now if i create a extension function inside the new file and import it within mainactivity
fun <ByteArray> ByteArray.toHex(): String{
return this.toString()
}
--
and in main activity
com.package.utils.*
it will be recognized as extended function, but i cannot get shared class to recoginz joinToString
kotlin- std-lib 1.70 both android and shared(common) class are using itrusshwolf
03/22/2023, 1:37 PMjoinToString
is usable from common, but format
is not. If you're having trouble resolving joinToString
it's probably because the type inference is getting confused after it fails to resolve format
.Zlatko
03/22/2023, 1:37 PM