title: Remove Firebase listener doesn't work Android
body: <p>I'm adding an event value listener to a reference and when I want to remove it, but it doesn't work.</p>
  
  <pre><code>override fun onStart() {
      super.onStart()
      stateListener =dbReference.stateRef.addValueEventListener(object : ValueEventListener {
  
          override fun onCancelled(p0: DatabaseError?) {
              TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
          }
  
          override fun onDataChange(snapshot: DataSnapshot?) {
             //there is my functions
          })
  }
  
  override fun onStop() {
      super.onStop()
      dbReference.stateRef.removeEventListener(stateListener)
      Log.d("My_TAG", "$stateListener ")
  }
  </code></pre>
  
  <p>This is the only place I'm adding the event.</p>
  
  <p>after editing (still don't work)</p>
  
  <pre><code>override fun onStart() {
      super.onStart()
      stateListener = object : ValueEventListener {
          override fun onCancelled(p0: DatabaseError?) {
              TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
          }
          //One of the phone got flipped
          override fun onDataChange(snapshot: DataSnapshot?) {
          }
  
      }
      dbReference.stateRef.addValueEventListener(stateListener)
  
  }
  
  override fun onStop() {
      super.onStop()
      Log.d("Life", "onStop")
      dbReference.stateRef.removeEventListener(stateListener)
  }
  </code></pre>