When to use the attach and detach methods of FragmentTransaction
I just went through the documentation of the attach() and detach() methods of FragmentTransaction : attach() : Re-attach a fragment after it had previously been detached from the UI with detach(Fragment) . This causes its view hierarchy to be re-created, attached to the UI, and displayed. Well, what does that mean? More specifically, I saw an example: mMapFragment = new MapFragment(); ft.beginTransaction(mMapFragment) .attach() .add(R.id.container, mMapFragment) .commit(); I deleted the attach() and tried again: I did not notice any difference. What does the attach do in this example? What is