title: Android MVP - loosing view reference in presenter "NullPointerException... null object reference"
body: <p>I'm using MVP in my demo project, in my View(fragment) I have two editTexts(case number and user name) and button. </p>
  
  <p>On Button click I want to insert that Case object to database. 
  So, firstly check if is there case with same number. And if it's false, I'm gonna save it to database and notify user that case is saved in database. Otherwise, just sending back message, that operation is failed and to try again with different number.  </p>
  
  <p>So object goes through the layers, View > Presenter > Model > Repository. 
  In Repository checking out conditions and sending a message back to view, trough same layers but vice versa (Repository>Model>Presenter>View).</p>
  
  <p>I Log.d all classes for errors and everything is fine. But when it comes back to Presenter I'm getting  "on a null object reference" for my view.</p>
  
  <p>method in my Presenter called from Model where I gets an error...</p>
  
  <pre><code>public void sameCaseNumberMessage(String string){
  
      Log.d(TAG, "message from repository" + string);
      view.showToastMessage(string); //but here, view is  on a null object reference
  }
  </code></pre>
  
  <p>In my View ...</p>
  
  <pre><code>@Inject
  BottomFragmentContract.Presenter presenter;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>@Override
  public void onResume() {
      super.onResume();
  
      presenter.setView(this);
  }
  </code></pre>
  
  <p>...</p>
  
  <p>In my Presenter ... </p>
  
  <pre><code>@Nullable
  private BottomFragmentContract.View view;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>@Override
  public void setView(BottomFragmentContract.View view) {
  
      this.view = view;
      Log.d(TAG, "Hashcode is fine : " + this.view.toString());
  }
  </code></pre>
  
  <p>...</p>