You can still use the Java conversion by calling the static function on java.lang.Integer:
val hexString = java.lang.Integer.toHexString(i)
And, starting with Kotlin 1.1, there is a function in the Kotlin standard library that does the conversion, too:
fun Int.toString(radix: Int): StringReturns a string representation of this
Intvalue in the specifiedradix.
Note, however, that this will still be different from Integer.toHexString(), because the latter performs the unsigned conversion:
println((-50).toString(16)) // -32
println(Integer.toHexString(-50)) // ffffffce
But with experimental Kotlin unsigned types, it is now possible to get the same result from negative number unsigned conversion as with Integer.toHexString(-50):
println((-50).toUInt().toString(16)) // ffffffce