In API 7 when try
val string = "string"
val bytes = string.toByteArray(Charset.forName("UTF-8"))
I get this exception:
java.lang.NoSuchMethodError: java.lang.String.getBytes
Is any way to get bytes from string without standard method? Looks like, conversion string to byte array starts with Api 8.