Android FragmentTransaction commit When?

前端 未结 4 1176
渐次进展
渐次进展 2020-12-05 01:56

I am building a tablet app. In this app there is one activity with two fragments. First fragment is a \"known\" list fragment which is showing a simple one item layout list

4条回答
  •  孤城傲影
    2020-12-05 02:17

    In Android API 24 FragmentTransaction has synchronous .commitNow() method. It's in the reference now: https://developer.android.com/reference/android/app/FragmentTransaction.html#commitNow()

    On the contrary, .commit() works asynchronously. It just schedules a commit of the transaction.

提交回复
热议问题