title: Android IOC Dagger Framework - How to inject a nested field ?
body: <p>I'm using Dagger for Android for dependency injections.
  I have a UserService object in a Main Class:</p>
  
  <pre><code>public class Main implements Runnable {
  
  @Inject
  UserService service;
  
  @Override
  public void run() {
      for (User f : service.getUserByName("toto")) {
          System.out.print(f.getM_Nom());
      }
  }
  
  public static void main(String[] args) {
      ObjectGraph objectGraph = ObjectGraph.create(new UserModule());
      Main m = objectGraph.get(Main.class);
      m.run();
  }
  }
  </code></pre>
  
  <p>I managed to inject the "service" field and to call the method "getUserByName("")". 
  But in my "UserService", I have an other custom object ("RepositoryUser" class):</p>
  
  <pre><code>public class UserService implements IUserService {
  
  @Inject
  RepositoryUser m_Repository;
  
  
  @Override
  public List&lt;User&gt; getUserByName(String name) {
      return m_Repository.getAll();
  }
  }
  </code></pre>
  
  <p>My problem is that this field is not inject: the "m_Repository" field is null and I get a null pointer exception when I try to use my RepositoryUser object.</p>
  
  <p>Here is my Provider:</p>
  
  <pre><code>@Module(
      injects = {UserService.class, Main.class, RepositoryUser.class}
  )
   public class UserModule {
  
  @Provides
  RepositoryUser provideRepositoryUser() {
      return new RepositoryUser();
  }
  
  @Provides
  UserService provideUserService() {
      return new UserService();
  }
  }
  </code></pre>
  
  <p>Any idea ?</p>
  
  <p>Thanks in advance !</p>