Refresh or force redraw the fragment

后端 未结 8 1675
失恋的感觉
失恋的感觉 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条回答
  •  盖世英雄少女心
    2020-11-30 02:39

    To solve the problem, I use this:

    Fragment frg = null;
    frg = getFragmentManager().findFragmentByTag("Feedback");
    final android.support.v4.app.FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.detach(frg);
    ft.attach(frg);
    ft.commit();
    

提交回复
热议问题