title: Android NPE while second calling interface
body: <p>I have some class <code>application class</code> extending <code>Application</code>. I use it as a controller  for filling the database and perfoming REST calls. There is an interface:</p>
  
  <pre><code>private OnDBfilled onFilledListener;
  ...
  public void setOnFilledListener(OnDBfilled onFilledListener) {
      this.onFilledListener = onFilledListener;
  }
  public interface OnDBfilled {
      void onFilledCallback();
  }
  ...
  </code></pre>
  
  <p>When I've got required  data  call it  to get known the <code>Fragment</code>, that data was successfully load from the internet and filled to database:</p>
  
  <pre><code>@Override
          public void onResponse(Call call, Response response) throws IOException {
  ...//working with data
  onFilledListener.onFilledCallback();
  }
  </code></pre>
  
  <p>For the  first  time, when the call is done and database is filled  I can  see  the result in the log:</p>
  
  <pre><code>private Application controller;
  private Application.OnDBfilled listener;
  ...
  controller = new Application();
  listener = new Application.OnDBfilled() {
          @Override
          public void onFilledCallback() {
              System.out.println("bd is filled. replacing fragments initiated editianal");
              replaceFragment();
          }
      };
   controller.setOnFilledListener(listener);
  </code></pre>
  
  <p>This works fine and I can see the  logging message. But  when I'm  trying to do in  the  another fragment, I've  got <code>Null Pointer Exception</code> in this line:</p>
  
  <pre><code> onFilledListener.onFilledCallback();
  </code></pre>
  
  <p>Here's code of another  fragment,  but it's almost equal:</p>
  
  <pre><code>  private Application controller;
  private Application.OnDBfilled filledDBListener;
  
  ...
  //onCreateView
  controller = new Application();
      filledDBListener = new Application.OnDBfilled() {
          @Override
          public void onFilledCallback() {
              swipeRefreshLayout.setRefreshing(false);
             // fillEventListFromBD(UserData.getCity(getActivity()));
          }
      };
      controller.setOnFilledListener(filledDBListener);
  </code></pre>
  
  <p>Any suggestions? Thanks!</p>