dependency injection - How to inject context using RoboGuice in Android? -


I would like to inject my references to my utility classes, I have seen the use of static fields, do so Are there any methods with static fields?

I use it to inject the context in order to use it.

  Public Class MyClass {Private Provider & lt; Context & gt; ContextProvider; Remove the @Public MyClass (provider & lt; context> reference provider) {this.contextProvider = contextProvider; } Public doSomething () {reference c = contextProvider.get (); }}    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -