title: How to change fragment with the Bottom Navigation Activity?
body: <p>I created a new project with the "Bottom Navigation Activity":</p>
  
  <p><a href="https://i.stack.imgur.com/fnCXr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fnCXr.png" alt="enter image description here"></a></p>
  
  <p>This is the generated code:</p>
  
  <pre><code>package com.aaron.waller.mrpolitik;
  
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.design.widget.BottomNavigationView;
  import android.support.v7.app.AppCompatActivity;
  import android.view.MenuItem;
  import android.widget.TextView;
  
  public class MainActivity extends AppCompatActivity {
  
      private TextView mTextMessage;
  
      private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
              = new BottomNavigationView.OnNavigationItemSelectedListener() {
  
          @Override
          public boolean onNavigationItemSelected(@NonNull MenuItem item) {
              switch (item.getItemId()) {
                  case R.id.navigation_home:
                      mTextMessage.setText(R.string.title_home);
                  case R.id.navigation_dashboard:
                      mTextMessage.setText(R.string.title_dashboard);
                  case R.id.navigation_notifications:
                      mTextMessage.setText(R.string.title_notifications);
              }
              return true;
          }
  
      };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mTextMessage = (TextView) findViewById(R.id.message);
          BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
          navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
      }
  
  }
  </code></pre>
  
  <p>How can I change to new Fragments with the Bottom Bar?
  For example I have 3 Fragments:
  Fragment1
  Fragment2 and
  Fragment3
  And I want to change to them with the 3 buttons from the Bottom Bar.
  Also I want that I can switch the Fragments by swiping my finger left and right how can I do that?</p>