How to notify adapter if the fragment deatched or destroyed [needed for Admob NativeAd AdViewHolder]
In my app, I have implemented ad mob native ads inside my PostAdapter class, I have 7 different fragments, and I need to know when the fragment is detached or destroyed to call nativeAd.destroy() to avoid leaks like said in the documentation
Be sure to use the destroy() method on loaded native ads. This frees up utilized resources and prevents memory leaks.
so my trying to solve this problem, I...