How do I destroy the RecyclerView adapter?

How do I destroy the RecyclerView adapter?
Answer
3 Answers
  1. Keep a subscription reference in the SiteAdapter. …
  2. unsubscribe the subscription object in onBindViewHolder (it’s called when the ViewHolder is reused)
  3. Keep the CompositeSubscription object in your adapter.
  4. Use the onDetachedFromRecyclerView method of your Adapter to unsubscribe the compositeSubscription.
13 авг. 2018 г.
 

Tìm kiếm

Back
Top