Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun goToFragment(view: View){
- val fmManager = supportFragmentManager
- val transaction = fmManager.beginTransaction()
- val fragment: Fragment
- when(view.tag) {
- "0" -> {
- fragment = PlayFragment.newInstance()
- isPlayModeOn = true
- }
- "1" -> {
- fragment = PracticeFragment.newInstance()
- }
- "2" -> {
- fragment = DiagramFragment.newInstance()
- }
- "3" -> {
- fragment = InstructionFragment.newInstance()
- }
- else -> {
- fragment = SettingsFragment.newInstance()
- }
- }
- fmManager.popBackStackImmediate()
- transaction.replace(R.id.mainApp, fragment).addToBackStack(null).commit()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement