I have two tabs in my app with two RecyclerView
that when I click on one item in the first tab it adds one item to the second tab (download link to download manager) but the user can't see the change until the fragment onDestroy
and again onCreate
(rotate, exit, going to the third tab) I think it happens because of the lifeCycle
of fragment in viewPager
that keeps the previous tab.
How can I force android to destroy fragment on tab change? I even tried setOnPageChangeListener
with interface but it did not work for me, maybe because getItem
only runs on fragment creation?