title: android listener interface variable null
body: <p>I refer to various codes and wrote as follows.</p>
  
  <pre><code>public CustomView bbv;
  bbv.setOnVariableChanged(new CustomView.VariableChanger() {  //error(line:132)
      @Override
      public void onVariableChanged() {
           real = true;
      }
  
  });
  </code></pre>
  
  <p>and</p>
  
  <pre><code>VariableChanger onVariableChanged;
  
  run(){
  
      ....
      if (count == 10) {
          if (onVariableChanged != null)
              onVariableChanged.onVariableChanged();
  }
  
  public void setOnVariableChanged(VariableChanger listener) {
      this.onVariableChanged = listener;
  }
  
  public interface VariableChanger {
      void onVariableChanged();
  }
  </code></pre>
  
  <p>When the count is 10, </p>
  
  <p>bbv.setOnVariableChanged (new CustomView.VariableChanger () throws an error.</p>
  
  <p>I don't know what's wrong.</p>
  
  <p>Thank you for answer.</p>
  
  <hr>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'void hci.parrot_bebop.view.BebopVideoView.setOnVariableChanged(hci.parrot_bebop.view.BebopVideoView$VariableChanger)' on a null object reference 
      at hci.parrot_bebop.activity.BebopActivity$1$1.run(BebopActivity.java:132)
      at java.util.Timer$TimerImpl.run(Timer.java:284)
  </code></pre>
  
  <hr>