I'm currently working in a Kotlin file with ValueAnimator's ofObject method: ValueAnimator.ofObject(TypeEvaluator evaluator, Object... values) in Android.
I have a Kotlin IntArray e.g.. fooIntArray that contains the values I need to pass into the varargs as individual objects. I've tried using the Spread * operator as follows: ValueAnimator.ofObject(someEvaluator, *fooIntArray, but the types aren't correct and I've tried to figure out how to cast fooIntArray to something like *fooIntArray as Array<Any> with no luck.
While working in Java with an int[] eg. fooIntArray, the only way I was able to successfully pass the int array was to cast it like this: ValueAnimator.ofObject(someEvaluator, (Object[] fooIntArray).
Does anyone have suggestions on how could I achieve the same thing in Kotlin?