I am using TabHost and Fragments. I have 3 tabs in TabHost. In first tab, I have 3 fragments and user can switch among them any number of times. My problem is that sometimes frgaments overlap each other. Similar questions have been asked by many users on stackoverflow and I have tried all possible solutions given, but issue still persists.
As per replies on stackoverflow: possible solutions which i got are:
- Having background for each fragment: I cant do this as my frgaments have no background. Parent activity has background and layout for tabs (those buttons which are used to switch between tabs) and fragments switching buttons in first tab, both have semi transparent background making activity background visible behind them As per this design I cant use background for each fragment.
- Using FragmentTranscation.replace(), using FragmentTranscation.remove() and FragmentTranscation.add() (although both replace and remove+add work same).
None of these solutions helped me.Also in my app, there is no need to put any fragment in backstack. Also this overlapping issue never appeared in Tabs. It appeared in fragments in 1st tab.
Please suggest a solution which actually works in my case.
Thanks