title: How to call (and use) onOptionsItemSelected from MainActivity in other classes
body: <p>I'm making my very first Android application but I ran into a problem.
  I have over 8 different classes which all use the same actionbar.
  Now in place of calling the method in every different class (and having a lot of double code) I would like to call the method of the main class in my other classes.</p>
  
  <p>This is a part of my code for the onOptionsItemSelected in main.java</p>
  
  <pre><code>@Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle presses on the action bar items
          switch (item.getItemId()) {
          case R.id.actionbar_new_income:
              Intent newIncome = new Intent(this, NewIncome.class);
              this.startActivity(newIncome);
              return true;
  } 
  }
  </code></pre>
  
  <p>Now I was wondering how I could call the method in another class (newIncome.java)
  I have this so far, but it keeps saying I need to add arguments. And I ofcourse need to be able to detect which menuitem is clicked..</p>
  
  <pre><code>MainActivity main = new MainActivity();
          main.onOptionsItemSelected();
  </code></pre>
  
  <p>Any help please?
  Thanks!</p>