0

I succeeded in making what I want previously. But I only called the method startListening() to recyclerAdapter. When should I call the method stopListening()?? Is there any disadvantage if not call the stopListening() method?

H.JiMan
  • 269
  • 1
  • 2
  • 10

1 Answers1

0

You can call stopListening() at onDetachedFromRecyclerView(RecyclerView recyclerView) method of recyclerViewAdapter.

  @Override
   public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
         stopListening();
   }
Santanu Sur
  • 10,997
  • 7
  • 33
  • 52