There are two activites. In the first one there is fragment1 and fragment2. In fragment1 there is a button that launches the second activation, and in it there is a button, when pressed, fragment2 from the first activation should open. How do I write onClick buttons in the second activation to open fragment2 from the first?

  • 2
    pass the parameter with the launch launch activation - which fragment should be opened (for example, pass true for the second, if there are only two, this will somewhat simplify the branching logic or the number, if there are more options) or if you return the hierarchy (the current activation closes finsh() ), then the same value is transmitted via onActivityResult() via onActivityResult() - pavlofff

0