2

I have few fragments. I have to swap them very often - so I dont want to use replace method. I'm using show and hide instead. Its working but rarely it doesn't show any fragment...

    if (fragment.isHidden()) {
        hideAll();
        FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
        ft.show(fragment);
        ft.commit();
        Log.i(TAG, "swaped to fragment: " + fragment.toString());
    }
    else
        Log.i(TAG, "fragment already visible");

This code is working in most cases but few times it leaves blank spot (only hideAll is working)

Do you know what (and why) it is happening?

Lau
  • 1,804
  • 1
  • 23
  • 49

0 Answers0