Can I use interface implementation by delegates wi...
# android
s
Can I use interface implementation by delegates with an activity? I mean, normally, we pass the delegate object through constructor, but here, we don't construct the activity's object. Is delegation possible with objects not created at constructor invocation?
a
You can write a primary constructor that accepts the delegate object and a secondary no-args constructor that calls the primary constructor with the appropriate delegate parameter. (Or use default arguments and
@JvmOverloads
)