In the app I use activity and three fragments. I add the fragments using the add (container, fragment, tag) method and use backStack (null). It was expected that the second added fragment (has a transparent frame) will block the first one and remove the focus from it. In fact, I can use the visible interface of the first fragment (through the transparent frame of the second), that is, it responds if you click on partially hidden widgets and it turns out porridge in the form of layers of several fragments. Tell me how to solve?

    1 answer 1

    So it should be. If the second fragment has a transparent background and skips clicks - the back fragment will be visible and it will be clickable.

    You can solve in different ways:

    1. Use replace instead of add
    2. Together with the add second fragment, call hide for the first.
    3. Make the background of the second fragment do not skip clicks further ( android:clickable="true" )