Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cribetti/17036d7c6f93cb6351f3f8ef5807fd45 to your computer and use it in GitHub Desktop.
Save cribetti/17036d7c6f93cb6351f3f8ef5807fd45 to your computer and use it in GitHub Desktop.
class MyActivity() : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
val fragment = MyFragment.newInstance("my argument")
supportFragmentManager.beginTransaction()
.replace(R.id.fragment_layout, fragment)
.commitNow()
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment