I have five tabs in Tablayout with fragments. I have a Floating button at the Bottom right corner of the first Tab. when I click the FAB button, it inflates a small CardView(Initially Cardview was set to INVISIBLE), and when I click FAB button again, Cardview goes to invisible state. (To achieve that, I have used 'flags' true and false).
Now, my requirement is--- Suppose, I am in first Tab. And I clicked the FAB button, in return, it inflated Cardview. Without clicking the FAB button again(Cardview is in VISIBLE state) I went to second Tab. Then, I moved to First Tab from the second Tab. but, still the Cardview stays VISIBLE state.
I want to make the Cardview INVISIBLE when I move to other Tabs and come back.
please tell me how to achieve that functionality.
Thanks in advance.