https://kotlinlang.org logo
#codereview
Title
# codereview
a

Aslam Hossin

05/05/2020, 4:54 AM
Listener registration not working in fragment to Dialog fragment communication. Am I missing anything for registration ?
Copy code
override fun onAttach(context: Context) {
    AndroidSupportInjection.inject(this)
    super.onAttach(context)
    if (context is Listener) {
      listener = context
    }
  }

  override fun onDetach() {
    super.onDetach()
    listener = null
  }
d

Dominaezzz

05/05/2020, 10:24 AM
Fragment is not a context iirc.
3 Views