旧的,但可能对其他人有用.要刷新片段,您需要分离片段并重新连接它
Fragment frg = null;
frg = getFragmentManager().findFragmentByTag("Your_Fragment_TAG");
final FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.detach(frg);
ft.attach(frg);
ft.commit();
Run Code Online (Sandbox Code Playgroud)
Your_Fragment_TAG是您在创建片段时为其提供的名称
| 归档时间: |
|
| 查看次数: |
18102 次 |
| 最近记录: |