Fragment je ponovno iskoristiv dio korisničkog sučelja koji se nalazi unutar Aktivnosti — modularna, samostalna komponenta korisničkog sučelja s vlastitim ciklom života. Fragmenti omogućavaju fleksibilna, ponovno iskoristiva sučelja i ključni su za moderne arhitekture s jednom Aktivnosti.
Što je Fragment
A FRAGMENT = a reusable, modular piece of UI hosted inside an Activity:
→ has its OWN lifecycle (tied to but distinct from the host activity's)
→ multiple fragments can be combined in one activity; reused across activities
→ represents a portion of the screen (or a whole screen's content)
→ Think: an activity can host one or more fragments that make up its UI.
