Understanding Fragment's lifeCycle methods calls during fragment transaction
Does this mean that no method of current fragment is called when new fragment is added in same activity?
Correct, your first fragment A will only be affected if it's removed or replaced (case 2). Simply adding another fragment will just display fragment B over fragment A and no life cycle callbacks should be called.
What i expected was?
onStart method of Fragment A is called since Fragment A is visible now
Again, since fragment B was added on top of A, fragment A is not affected by the removal of B.
onDestroy and onDetach method of Fragment A is NOT called.Why its not called?Bcoz as per documentation method replace removes any fragments that are already in the container and add your new one to the same container
Unlike a simple replace, when you add your replace transaction to the backstack you're actually keeping the first fragment attached to it's activity, only its view is destroyed.
Once you pop the backstack fragment B is removed and fragment A will just recreate its view - starting from onCreateView().