Thursday, 8 August 2013

Way to update Fragment's UI after state changes

Way to update Fragment's UI after state changes

I'm trying to reuse the same Fragment simply swaping some instance
variables in the Fragment. My problem is that I can't force the UI to
update. I tried:
detailFragment.setDetails(bundle);
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.detailFragment, detailFragment);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
but it doesn't seem to make any changes to my UI. At the same time when I
create a new DetailFragment() the same code works fine and changes UI.
Could you help?

No comments:

Post a Comment