title: Open Activity by clicking in the menu button- Android Studio
body: <p><strong>I am a beginner</strong>, <strong>I am a few days with this problem</strong></p>
  
  <p>I didn't find a solution. I have a menu that appears in an activity and when I click, I want it to open a new activity.</p>
  
  <p>My question is, what to put in the activity with menu, and what to put in the new activity?</p>
  
  <p>This is my code</p>
  
  <hr>
  
  <p><strong>Menu_chat.xml   (my menu)</strong></p>
  
  <pre><code>   android:id="@+id/salva_vida"
     android:icon="@drawable/salva_vida"
     android:title="@string/save_life"
     app:showAsAction="always" /&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>ChatActivity.java  (this is the activity with menu)</strong></p>
  
  <pre><code> @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          int id = item.getItemId();
  
          switch (id) {
              case android.R.id.home:
                  onBackPressed();
                  return true;
  
              case R.id.salva_vida:
                  ???????  (What put here?)------------------
                  break;
  </code></pre>
  
  <hr>
  
  <p><strong>tab2.java   (this is the new activity- I want to open this)</strong></p>
  
  <pre><code>public class tab2 extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_tab2);
      }
  }
  </code></pre>