how to get a fragment added in an XML layout

前端 未结 5 1500
暗喜
暗喜 2020-12-05 12:27

I have a layout which includes a fragment as follows:



        
5条回答
  •  日久生厌
    2020-12-05 13:05

    You can find the fragment using findFragmentById (if you know the component it is included in) or by findFragmentByTag (if you know its tag)

    I don't know which variables you want to update, but you can replace the fragment with another fragment using the FragmentTransaction API.

    See http://developer.android.com/guide/components/fragments.html for examples.

提交回复
热议问题