SHARE
TWEET

Untitled

a guest Feb 27th, 2020 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun goToFragment(view: View){
  2.         val fmManager = supportFragmentManager
  3.         val transaction = fmManager.beginTransaction()
  4.         val fragment: Fragment
  5.         when(view.tag) {
  6.             "0" -> {
  7.                 fragment = PlayFragment.newInstance()
  8.                 isPlayModeOn = true
  9.             }
  10.             "1" -> {
  11.                 fragment = PracticeFragment.newInstance()
  12.             }
  13.             "2" -> {
  14.                 fragment = DiagramFragment.newInstance()
  15.             }
  16.             "3" -> {
  17.                 fragment = InstructionFragment.newInstance()
  18.             }
  19.             else -> {
  20.                 fragment = SettingsFragment.newInstance()
  21.             }
  22.         }
  23.         fmManager.popBackStackImmediate()
  24.         transaction.replace(R.id.mainApp, fragment).addToBackStack(null).commit()
  25.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top