How FragmentTransaction way affect Fragment life cycle

The problem
has not been a clear FragmentTrasaction of add, remove, replace, hide, show, replace, attach, detach method is how it affects Fragment of the life cycle? ? ? ? ? ?
Experiments are as follows:

  1. the Add ()
    Here Insert Picture Description
    2.remove ()
    Here Insert Picture Description
    3.replace () is equivalent to remove and then the Add
    4.hide () lifecycle method will not be called back
    Here Insert Picture Description
    5.show () lifecycle method will not be called back
    Here Insert Picture Description
    6.detach ()
    Here Insert Picture Description
    7. attach ()
    Here Insert Picture Description

Note: after which the log is performed onClick a corresponding method, Fragment of isAdd () method returns the result.

Guess you like

Origin blog.csdn.net/reuxfhc/article/details/93737650