1. Static loading
1.1 First define a layout file for each fragment.
1.2 Create each fragment class, you need to inherit fragment. and use the Inflater.inflate () method of Oncreateview () to return to the layout file.
1.3 Add the tag fragment to the main layout and set the relevant properties. (Layout_width,layout_weight,name ...)
2. Dynamic loading
2.1 First define a layout file for each fragment.
2.2 Create each fragment class, you need to inherit fragment. and use the Inflater.inflate () method of Oncreateview () to return to the layout file.
2.3 Setting the ID of the primary layout
2.4 Use Getfragmentmanager (). BeginTransaction (). replace (R.ID.MAIN_LAYOUT1,FRAGMENT1). commit (); To load the fragment.
Transfer data between 3.fragment
3.1 Use, getactivity () to obtain the relevant space, and to carry out the function of the data. (Fragment must be loaded under the same form)
"Notes" fragment use