Last active
July 17, 2018 20:01
-
-
Save AreJay-Smith/46e899deeb81c14c3a4cf8398816570a to your computer and use it in GitHub Desktop.
Replace Fragment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create new fragment (Either map or list fragment) and the transaction | |
val listFragment = ListFragment() | |
val transaction = fragmentManager!!.beginTransaction() | |
// Replace whatever is in the fragment_container view with this fragment, | |
// and add the transaction to the back stack if needed | |
transaction.replace(R.id.fragment_container, listFragment) | |
transaction.addToBackStack(null) | |
// Commit the transaction | |
transaction.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment