Open n0k opened 9 years ago
Or indeed is it possible to execute custom code after onCreate is executed at runtime?
Dagger doesn't support method injection, but I'm not sure I understand how that relates to your desire to run code after onCreate (if I'm understanding you correctly, you want to run some code AFTER onCreate completes?) For that, you could just override onCreate and post a Runnable to a Handler. If you need that Runnable to be injected, you could use fb-android-dagger to inject it during onCreate.
Note: if you do that, though, beware of Activity references used by your runnable: https://corner.squareup.com/2013/12/android-main-thread-2.html
Hi,
I'm new to Dagger and fb-android-dagger and was wondering if it is possible to use fb-android-dagger to inject custom code in an existing method in an Android Activity like onCreate. Is there a way to annotate an Activity to make this possible?
Thanks!