Lecture no 05 Introduction to Fragments
Lecture no 05 Introduction to Fragments
Fragments
Fragments in Android are modular section of an activity, which
encapsulates their own behavior and functionality.
2 Running
During the running phase, the fragment is actively interacting with the
user and processing user input. It's the main state where the fragment
performs its primary functions.
3 Termination
When the fragment is no longer needed, it goes through the termination
phase where resources are released, and it is detached from the activity.
This marks the end of the fragment's lifecycle.
Creating and managing Fragments
Fragment Creation Fragment Lifecycle Fragment Back Stack
Best for modular and reusable UI Suitable for standalone user interfaces.
components.
Ideal for larger screens and multi-pane Preferred for simpler and linear UI flows.
layouts.