(` bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottom_navigation); bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case R.id.select1: break; case R.id.statistic: Intent a = new Intent(MainActivity.this, Records.class); startActivity(a); break; } ` 

I have already created activities earlier, but I want to call them through Bottom Navigation. But the transition is sharp. It turns out. How to do it smoothly, like for example on Instagram

enter image description here

    1 answer 1

    This must be done through fragments. Or connect the viewpager

    • Fragment mFragment = new YourNextFragment (); getSupportFragmentManager (). beginTransaction (). replace (R.id.content_frame, mFragment) .commit (); So? - Jeck3ser
    • Yes. But implement better through the viewpager - pavel163
    • Yes, but the ViewPager is not what I wanted - Jeck3ser