title: how to change actionBar title of Activity1 from a button of Activity2
body: <p>I am trying to make a button in activity2(settings page), when the button is clicked, then the title of activity1(MainActivity) will change to what I set to. I have been trying to use interface to carry out the function but it gives me a null pointer exception error.</p>
  
  <p>MainActivity</p>
  
  <pre><code>@Override
      public void changeActionBarTitle(String editText){
          actionTitle = editText;
          setTitle(actionTitle);
      };
  </code></pre>
  
  <p>Interface</p>
  
  <pre><code>public interface ActionBarInterface {
      void changeActionBarTitle(String editText);
  }
  </code></pre>
  
  <p>Setting page (activity 2)</p>
  
  <pre><code>public class SettingsPage extends AppCompatActivity {
      ActionBarInterface actionBarInterface;
      Button editCompanyNameButton;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_settings_page);
          setTitle("Settings");
  
          editCompanyNameButton = findViewById(R.id.editCompanyNameButton);
          editCompanyNameButton.setOnClickListener(new View.OnClickListener(){
              @Override
              public void onClick(View view){
                  actionBarInterface.changeActionBarTitle("test");
              }
          });
      }
  }
  </code></pre>
  
  <p>Thanks.</p>