i want to store a Class in a variable, the purpose is to check if other variable is an instanceOf the class
Here is My Code :
when (it.itemId) {
R.id.vend_list -> {
replace(R.id.fragmentContainer, vendingList)
id = VendListClass
}
R.id.label -> {
replace(R.id.fragmentContainer, label)
id = LabelClass
}
R.id.home -> {
replace(R.id.fragmentContainer, mainMenu)
id = MainMenuClass
}
R.id.statistic -> {
replace(R.id.fragmentContainer, statistic)
id = StatisticClass
}
else -> {}
}
for(fragment in supportFragmentManager.fragments){
if(fragment !is id){
remove(fragment)
}
}