Is there a way to keep fragment alive when using BottomNavigationView with new NavController?

Try this. Navigator Create custom navigator. @Navigator.Name(“custom_fragment”) // Use as custom tag at navigation.xml class CustomNavigator( private val context: Context, private val manager: FragmentManager, private val containerId: Int ) : FragmentNavigator(context, manager, containerId) { override fun navigate(destination: Destination, args: Bundle?, navOptions: NavOptions?) { val tag = destination.id.toString() val transaction = manager.beginTransaction() val currentFragment = manager.primaryNavigationFragment … Read more

Android new Bottom Navigation bar or BottomNavigationView

I think you might looking for this. Here’s a quick snippet to get started: public class MainActivity extends AppCompatActivity { private BottomBar mBottomBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Notice how you don’t use the setContentView method here! Just // pass your layout to bottom bar, it will be taken care of. // … Read more

How to disable BottomNavigationView shift mode?

Implementation of BottomNavigationView has condition: when there is more than 3 items then use shift mode. At this moment you cannot change it through existing API and the only way to disable shift mode is to use reflection. You’ll need helper class: import android.support.design.internal.BottomNavigationItemView; import android.support.design.internal.BottomNavigationMenuView; import android.support.design.widget.BottomNavigationView; import android.util.Log; import java.lang.reflect.Field; public class BottomNavigationViewHelper … Read more

Set selected item in Android BottomNavigationView

From API 25.3.0 it was introduced the method setSelectedItemId(int id) which lets you mark an item as selected as if it was tapped. From docs: Set the selected menu item ID. This behaves the same as tapping on an item. Code example: BottomNavigationView bottomNavigationView; bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigationView); bottomNavigationView.setOnNavigationItemSelectedListener(myNavigationItemListener); bottomNavigationView.setSelectedItemId(R.id.my_menu_item_id); IMPORTANT You MUST have already … Read more

BottomNavigationView display both icons and text labels at all times

For anyone still looking for a solution and doesn’t want to rely on third party libraries or runtime reflection, BottomNavigationView in Support Library 28/Jetpack natively supports always having text label. This is the method you’re looking for. Or in XML, app:labelVisibilityMode=”labeled”

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)