A Fragment shine wani yanki mai amfani na UI wanda yake zaune a cikin Activity — wani component na UI mai tsari, mai kansa-sarau tare da dalilinsa sarari. Fragments suna ba da damar UI masu ƙarfi, na gida, kuma suna da mahimmanci ga gida moderne na single-Activity.
Abin da Fragment yake
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.
