我创建了kotlin底部导航活动,然后单击底部导航按钮,然后尝试显示kotlin主题类。单击底部主题底部后,我不确定如何添加subject.kt类。请分享您的想法。
Student.kt
class StudentNames : AppCompatActivity(){
private val mOnNavigationItemSelectedListener = BottomNavigationView.OnNavigationItemSelectedListener { item ->
when (item.itemId) {
R.id.navigation_home -> {
message.setText(R.string.title_home)
//replaceFragment(StudentMenuList())
return@OnNavigationItemSelectedListener true
}
R.id.navigation_dashboard -> {
message.setText(R.string.title_dashboard)
return@OnNavigationItemSelectedListener true
}
R.id.navigation_notifications -> {
message.setText(R.string.title_notifications)
return@OnNavigationItemSelectedListener true
}
}
false
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_Student_names)
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)
// replaceFragment(StudentMenuList())
}
}