The code containing the error is:
public class HomeActivity extends AppCompatActivity { BottomNavigationView bottomNavigation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); bottomNavigation = (BottomNavigationView) findViewById(R.id.bottomNavigation); bottomNavigation.setOnNavigationItemReselectedListener(navigation); } private BottomNavigationView.OnNavigationItemReselectedListener navigation = new BottomNavigationView.OnNavigationItemReselectedListener() { @Override public boolean onNavigationItemReselected(@NonNull MenuItem item) { switch (item.getItemId()) { case R.id.home: Toast.makeText(HomeActivity.this, "HOME", Toast.LENGTH_SHORT).show(); break; case R.id.category: Toast.makeText(HomeActivity.this, "CATEGORY", Toast.LENGTH_SHORT).show(); break; } return true; } }; } It is possible to see the error in this screenshot.
The code shows a Toast with the text corresponding to the selected view.
onNavigationItemReselectedreturns void notboolean