title: How to remove Firebase EventListener?
body: <p>Can enyone explain to me how to remove firebase Eventlistener/childEventlistener in Android realtime database and how to detect if the listener is successfully removed? I use below code but not sure this is ok or not </p>
  
  <pre><code>class dummy AppCompatActivity() {
   lateinit var dbRaceRef: DatabaseReference
      lateinit var mListener: ValueEventListener
  oncreate{
  
  mListener = dbRaceRef.addValueEventListener(object : ValueEventListener {
  
              override fun onCancelled(p0: DatabaseError) {
              }
  
              override fun onDataChange(p0: DataSnapshot) {
                  // do something
                  }
              }
          })
  }
  
  ondestroy{
  dbRaceRef.removeEventListener(mListener)
  }
  }
  </code></pre>
  
  <p>And what happens if I didn't remove my listener. When it will be destroyed automatically? Can we somehow check what are the active listeners in my database?</p>