we have an adapter class(E.g. AdapterA) which creates different fragments using CreateFragment method when user clicks the different Tabs of Tablayout.

Based on the fragment, the menu options are created in each fragment's onCreateOptions method in which one of the item is (Un)Select All.

When user switches to a different fragment outside the adapter, and come back to AdapterA class, the menu item is referring to old adapter instance instead of the newly created instance of AdapterA.

How to GC the old adapter instance and update the menu options

We tried making adapter class singleton so that it uses same instance but it didnt work

0

There are 0 best solutions below