Skip to content

Instantly share code, notes, and snippets.

@svinouze
Created November 5, 2020 13:40
Show Gist options
  • Save svinouze/d3c7b688d27c68082822ce773156b1ae to your computer and use it in GitHub Desktop.
Save svinouze/d3c7b688d27c68082822ce773156b1ae to your computer and use it in GitHub Desktop.
class FabulousActivity : Activity(), FabulousListener {
companion object {
fun newIntent(context: Context): Intent = Intent(context, FabulousActivity::class.java)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Commit FabulousFragment instance into FragmentManager
}
override fun onAttachFragment(fragment: Fragment) {
super.onAttachFragment(fragment)
when (fragment) {
is FabulousListener -> fragment.listener = this
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment