r2vq
04/30/2019, 6:23 PMclass MyClass(private val getString: (Context, Int, Array<String>) -> String)
I can call it with a lambda as such:
MyClass { context, resId, formatArgs -> context.getString(resId, formatArgs) }
But I can also use a method reference for the first parameter and if the signature matches the second and third parameter.
MyClass(Context::getString)
This is really cool. Is there a specific page on the docs where I can read more about this? I would love to learn more but my google-fu is failing me on this topic.Joe
04/30/2019, 6:26 PMfred.deschenes
04/30/2019, 6:26 PMr2vq
04/30/2019, 8:10 PM