Android multiple fragment transaction ordering

前端 未结 5 1777
离开以前
离开以前 2020-12-09 05:10

I have a HorizontalScrollView containing a (horizontal) LinearLayout which I use as the container for adding multiple fragments. Upon some changes,

5条回答
  •  青春惊慌失措
    2020-12-09 05:44

    Had a similar issue, the solution I ended up using was to have multiple transactions. In my case, it was only A, B, C. And I used one transaction to add A, one to add B, one to add C.

    The order of transactions seems to be reliable.

    Probably requires more complex code, if you wish to have backstack working. But a backstack tag on the first transaction should allow proper handling there, too.

提交回复
热议问题