Join Slack
Powered by
Hi, how do I instantiate a class passed through as...
# announcements
r
robinchew
10/24/2018, 8:47 PM
Hi, how do I instantiate a class passed through as a function argument? The following don't work.
Copy code
fun myFunc(aClass: KClass<out View>) { return aClass() } myFunc(TextView::class)
I get
invoke()
not found error, and if I get android studio to auto create extension it. I get other errors.
2
Views
Open in Slack
Previous
Next