Refresh or force redraw the fragment

后端 未结 8 1651
失恋的感觉
失恋的感觉 2020-11-30 02:10

I have a fragment that inflates an xml layout. My requirement is to update the text size on all my views inside my fragment when my Activity is resumed. I tried



        
8条回答
  •  萌比男神i
    2020-11-30 02:52

    In my case,detach and attach work for me.

     getSupportFragmentManager()
                    .beginTransaction()
                    .detach(contentFragment)
                    .attach(contentFragment)
                    .commit();
    

提交回复
热议问题