title: How to change activity on bottom navigation button click?
body: <p>I want to use bottom navigation bar in my existing android app but the problem is all screen are activity ,is it possible to load activity without hiding the bottom navigation bar.</p>
  
  <p><strong>example:</strong>
  <strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:id="@+id/myScrollingContent"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;!-- Your loooooong scrolling content here. --&gt;
  
      &lt;/android.support.v4.widget.NestedScrollView&gt;
      &lt;com.roughike.bottombar.BottomBar
          android:id="@+id/bottomBar"
          android:layout_width="match_parent"
          android:layout_height="60dp"
          android:layout_gravity="bottom"
          app:bb_tabXmlResource="@xml/bottom_bar"
          app:bb_behavior="shy"/&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>this is my base activity,</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.activity_main);
          BottomBar bottomBar;
          bottomBar = (BottomBar) findViewById(R.id.bottomBar);
          bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
              @Override
              public void onTabSelected(@IdRes int tabId) {
                  if (tabId == R.id.matching) {
                      Log.i("matching","matching inside "+tabId);
                      Intent in=new Intent(getBaseContext(),Main2Activity.class);
                      startActivity(in);
                  }else if (tabId == R.id.watchlist) {
                      Log.i("matching","watchlist inside "+tabId);
                      Intent in=new Intent(getBaseContext(),Main3Activity.class);
                      startActivity(in);
                  }
              }
          });
      }
  }
  </code></pre>
  
  <p><strong>Main2Activity</strong></p>
  
  <pre><code>public class Main2Activity extends MainActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //setContentView(R.layout.activity_main2);
          NestedScrollView dynamicContent = (NestedScrollView) findViewById(R.id.myScrollingContent);
          View wizard = getLayoutInflater().inflate(R.layout.activity_main2, null);
          dynamicContent.addView(wizard);
  </code></pre>
  
  <p><strong>Main3Activity</strong></p>
  
  <pre><code>public class Main3Activity extends MainActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //setContentView(R.layout.activity_main3);
          NestedScrollView dynamicContent = (NestedScrollView) findViewById(R.id.myScrollingContent);
          View wizard = getLayoutInflater().inflate(R.layout.activity_main3, null);
          dynamicContent.addView(wizard);
  
  
      }
  }
  </code></pre>
  
  <p><strong>manifest</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.bottom.bottomnavigation"&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".Main2Activity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".MainActivity" /&gt;
          &lt;activity android:name=".Main3Activity"&gt;&lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>