Reputation: 546
What is the better practice for removing fragments (when the animation is not required) using fragmentTransaction.remove or changing the fragment container view visibility to GONE - setVisibility(GONE);
Upvotes: 0
Views: 553
Reputation: 13801
Removing the fragment will cause the entire fragment to be destroyed (onStop and onDestroy will be called).
Setting the visiblity to GONE will only hide the view from the user. The fragment instance will still exist and run through life cycle events.
Upvotes: 1