14. Add it dynamically to activity using fragment
manager
FragmentManager fragmentManager =
getFragmentManager();
FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction();
ExampleFragment fragment = new
ExampleFragment();
fragmentTransaction.add(R.id.fragment_contain
er, fragment);
fragmentTransaction.commit();
15. Fragment represent sub-activity
On attach and on detach like view.
The other callback like activity.
16. Non UI Fragment
◦ Background worker
Not a service
Die when activity die
◦ Cache data
Backup and restore when configuration change