In Android, a fragment is a modular section of an activity. It has its own lifecycle and receives its own input events, and it can be added or removed from an activity while the activity is running. Fragments are typically used to create user interfaces that can be reused across multiple activities, or to create more dynamic and flexible user interfaces that can respond to different screen sizes and orientations.
| Topics | Meaning | Reference | Videos |
|---|---|---|---|
| Fragment Lifecycle | Understanding the lifecycle events that happen to a fragment | https://developer.android.com/guide/components/fragments#Lifecycle | |
| Creating a Fragment | Steps and instructions on creating a new fragment | https://developer.android.com/training/basics/fragments/creating | |
| Adding a Fragment to an Activity | How to add a fragment to an activity | https://developer.android.com/training/basics/fragments/fragment-ui | |
| Communicating between Fragments | How to pass data between fragments and activities | https://developer.android.com/training/basics/fragments/communicating | |
| Saving Fragment State | How to save and restore a fragment's state | https://developer.android.com/guide/fragments/saving-state | |
| Fragment Transactions | How to add, remove, replace, and perform other fragment transactions | https://developer.android.com/guide/fragments/transactions | |
| Fragment Layouts | How to create layouts for fragments | https://developer.android.com/guide/fragments/create-ui | |
| DialogFragment | How to use a fragment as a dialog | https://developer.android.com/guide/fragments/dialog | |
| ListFragment | How to use a fragment to display a list of items | https://developer.android.com/guide/components/fragments-list | |
| FragmentManager | How to manage fragments in your activity | https://developer.android.com/guide/components/fragments#Managing |