title: Calling a Fragment Method in an Activity causes a Null Pointer Exception
body: <p>I want to call the Fragment Method when I click on the FloatingActionButton.<br>
  I am using Butterknife.</p>
  
  <p>Error:</p>
  
  <blockquote>
    <p>PID: 9956                                                                                      java.lang.NullPointerException: Attempt to invoke virtual method 'void com.fischerdaniel.testapp.FirstFragment.setTvText()' on a null object reference</p>
  </blockquote>
  
  <p>The part of the MainActicity:</p>
  
  <pre><code>  @OnClick({R.id.fab_one, R.id.fab_two, R.id.fab_three}) public void test(View view) {
          switch (view.getId()) {
              case R.id.fab_three:
                  FirstFragment firstFragment = (FirstFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_first);
                  firstFragment.setTvText();
                  break;
              default:
                  break;
          }
      }
  </code></pre>
  
  <p>The part of the Fragment:</p>
  
  <pre><code>    @BindView(R.id.et_one) EditText etOne;
      @BindView(R.id.et_two) EditText etTwo;
      @BindView(R.id.tv_one) TextView tvOne;
      @BindView(R.id.tv_two) TextView tvTwo;
  
      private Unbinder unbinder;
  
     @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.fragment_first, container, false);
          unbinder = ButterKnife.bind(this, view);
  
          return view;
      }
  
      protected void setTvText() {
          tvOne.setText(etOne.getText());
          tvTwo.setText(etTwo.getText());
      }
  </code></pre>