Created
October 12, 2017 20:07
-
-
Save MartuPuri/7fec905b75d50bee603f385058056a7f to your computer and use it in GitHub Desktop.
Kotlin Extension - FragmentActivity
This file contains 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
fun FragmentActivity.initialFragment(fragment: Fragment, | |
@IdRes fragmentContentId: Int) { | |
val fragmentManager = supportFragmentManager | |
val fragmentTransaction = fragmentManager.beginTransaction() | |
fragmentTransaction.add(fragmentContentId, fragment).commit() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment