title: When i try to open new activity this is = null when using dagger 2
body: <p><strong>this is my mvp module</strong></p>
  
  <pre><code>@Module
  public class LoginModule {
  
      @Provides
      public LoginPresenterImpl providePresenter(LoginView loginView , LoginInteractor loginInteractor) {
  
          return new LoginPresenterImpl(loginView,loginInteractor);
      }
  
      @Provides
      public LoginView loginView(){
  
          return new LoginActivity();
      }
  
      @Provides
      public LoginInteractor loginInteractor(Repository repository){
  
          return new LoginInteractorImpl(repository);
      }
  
      @Provides
      public Repository provideRepository(APIInterfaces.LoginInterface loginInterface){
          return new Repository(loginInterface,loginView());
      }
  
      @Provides
      public LoginPresenter loginPresenter(APIInterfaces.LoginInterface loginInterface){
  
          return providePresenter(loginView(),loginInteractor(provideRepository(loginInterface)));
      }
  }
  </code></pre>
  
  <p><strong>this my login activity</strong></p>
  
  <pre><code>{
  ProgressHUD progressHUD;
  private LinearLayout main_layout;
  private boolean flag = false;
  
  
  
  private EditText email_edt, password_edt;
  private ImageView login_btn;
  private TextView sign_up_tv, forget_password_tv;
  @Inject
  public LoginPresenter loginPresenter;
  
  @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  @Override
  protected void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login);
      //getWindow().setStatusBarColor(Color.TRANSPARENT);
      //        flag = getIntent().getBooleanExtra("from_splash", false);
      //        loginPresenter = new LoginPresenterImpl(this,new LoginInteractorImpl());
  
      MyApplication.getComponent().inject(this);
  
      setControls();
  
  
  }   //  onCreate()
  
  @Override
  protected void onDestroy() {
      loginPresenter.onDestroy();
      super.onDestroy();
  }
  
  private void setControls() {
      main_layout =  findViewById(R.id.main_login_layout);
      email_edt =  findViewById(R.id.edt_txt_email);
      password_edt =  findViewById(R.id.edt_txt_password);
      sign_up_tv =  findViewById(R.id.sign_up_txt);
      forget_password_tv =  findViewById(R.id.forget_password_txt);
      login_btn =  findViewById(R.id.login_btn);
  
      login_btn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
              loginPresenter.validateEmailPassword(email_edt.getText().toString().trim(),password_edt.getText().toString().trim());
          }
      });
  
      sign_up_tv.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
              loginPresenter.openRegistrationPage();
          }
      });
  
      forget_password_tv.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
          }
      });
  
      if(flag)
          Logging.Snackbar(main_layout, getString(R.string.check_internet_msg));
  
  
  }   //  setControls()
  
  @Override
  public void showProgress() {
      //progressHUD = ProgressHUD.show(LoginActivity.this, getString(R.string.loading_txt), false, null, null);
  }
  
  @Override
  public void hideProgress() {
      //progressHUD.dismiss();
  }
  
  @Override
  public void passwordError(int x) {
  
      switch (x)
      {
          case 0 :
              password_edt.setError(getString(R.string.password_length_error_msg));
              break;
          case 1 :
              password_edt.setError(getString(R.string.empty_field_error_msg));
              break;
  
      }
  }
  
  @Override
  public void emailError(int y) {
      switch (y)
      {
          case 0 :
              email_edt.setError(getString(R.string.empty_field_error_msg));
              break;
  
          case 1 :
              email_edt.setError(getString(R.string.invalid_email_error_msg));
              break;
          case 2 :
              email_edt.setError(getString(R.string.invalid_email_error_msg));
              break;
      }
  
  }
  
  @Override
  public void openRegistration() {
      Intent intent = new Intent(LoginActivity.this, RegistrationActivity.class);
      startActivity(intent);
      finish();
  }
  
  @Override
  public void forgetPassword() {
  
  }
  
  @Override
  public void navigateToHome(Response&lt;LoginResponse&gt; response) {
  
      if (response.body().getError() == 0 &amp;&amp; response.body().getMessage().equalsIgnoreCase("Login Success"))
      {
  
          UserData userData = new UserData();
  
         Intent intent = new Intent(this,MainPageActivity.class);
  
          userData = response.body().getData();
          intent.putExtra("UserData",userData);
  
          startActivity(intent);
          finish();
      }
      else
      {
          Logging.Toast(this,response.body().getMessage());
      }
  
  }
  
  @Override
  public void onError() {
  
      Logging.Toast(this,"Check Your Internet Connection");
  }
  }
  </code></pre>
  
  <blockquote>
    <p>when i try to navigate to home activity LoginActivity.this is return null how to solve this.
    this is the error that i get 
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
                                                                          at android.content.ContextWrapper.getPackageName(ContextWrapper.java:141)</p>
  </blockquote>