Anyone knows how to invoke a method before a metho...
# android
s
Anyone knows how to invoke a method before a method that has a custom annotation? I want to run some code before this method with a custom annotation. How can we do this in kotlin?
stackoverflow 1
f
Create a wrapper around this method, and use the second one
a
Sounds like AOP, there's
kapt
to do annotation processing, but usually you would use some framework for it? You could also instead of having the annotation call the method directly at start? Personally I haven't really used a lot of AOP
s
Yes, I've came across aspect oriented programming,.. the idea is to create a library and for each method annotated in the app and when that method is called, run some code. I don't know if that's possible.