title: Inject custom class dialog with dagger2
body: <p>I have a problem with dagger, I am trying to understand how it work. I have a custom class that extend of dialog class, So I would like to inject this class in all activitys or fragment for just to show o hide my dialog.</p>
  
  <p>This is my custom class.</p>
  
  <pre><code>public class Loader extends Dialog {
  
      public static AVLoadingIndicatorView avi;
      public static TextView title;
  
      @Inject
      public Loader(@ApplicationContext  Context context) {
          super(context, R.style.TransparentProgressDialog);
          this.setContentView(R.layout.loader);
          avi = (AVLoadingIndicatorView) findViewById(R.id.load);
          title = (TextView) findViewById(R.id.title);
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
      }
  
      public void setTitle(String t){
          title.setText(t);
      }
  }
  </code></pre>
  
  <p>Note: this class need to a context like parm in the constructor and used a library to show a cool progress.</p>
  
  <pre><code>enter code here
  My module class is this.
  
      @Provides
      @ApplicationContext
      Context provideContext() {
          return mApplication;
      }
  
      @Provides
      public Loader provideLoader(@ApplicationContext Context context){
          return new Loader(context);
      }
  </code></pre>
  
  <p>My component.</p>
  
  <pre><code>enter code here
  @Singleton
  @Component(modules = ApplicationModule.class)
  public interface ApplicationComponent {
  
       @ApplicationContext
       Context context();
  
       Application application();
       PreferencesHelper getPreferences();
       Loader loader();
  
  
       void inject(MyFirebaseInstanceIDService myFirebaseInstanceIDService);
       void inject(SplashActivity splashActivity);
       void inject(SignUpActivity signUpActivity);
  }
  </code></pre>
  
  <p>Finally I inject to in my activity.</p>
  
  <pre><code>enter code here
  public class SignUpActivity extends AppCompatActivity{
  
      SignUpContract.Presenter presenter;
  
      @Inject
      PreferencesHelper preferences;
  
      @Inject
      Loader loader;
  
      @Override
      protected void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_signup);
          ButterKnife.bind(this);
  
  
          ((MyApplication) getApplicationContext()).getComponent().inject(this);
  
          loader.setTitle(getString(R.string.dialog_processing));
  
          loader.show();
  
      }
  }
  </code></pre>
  
  <p>I appreciate any help to understand more about dagger. Thanks</p>
  
  <pre><code> Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
  </code></pre>