I am trying to set default item on activity created but it isn\'t working? This is my code:
protected void onCreate(Bundle savedInstanceState) {
super.o
If what you want is that the clicked element is ignored on the view and is not returned as "selected" you can return false after the click is handled, in some cases and some designs you could need to open an activity instead of a fragment and this will make selected the bottom item after the activity is closed.
private val onNavigationItemSelectedListener = BottomNavigationView.OnNavigationItemSelectedListener { item ->
when (item.itemId) {
R.id.navigation_shipment -> {
currentItem = TAB_INDEX_SHIPMENT
val intent = Intent(this, BookShipmentActivity::class.java)
startActivity(intent)
return@OnNavigationItemSelectedListener false
}
}
false
}