In this code, I used findViewById. logcat says java.lang.NullPointerException: findViewById(R.id.bottom_navigation) must not be null So, when I looked up, it is recommended