1/20
This set of flashcards covers the fundamental concepts of Fragments, their lifecycle states, FragmentManager operations, and the Navigation Components as presented in Lecture 7.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Fragment
A block of UI, with its own lifecycle, that can be reused within different activities to create modular user-interface components.
onInflate
Method called only to define a fragment directly in the layout using the tag; it saves configuration parameters and attributes defined in the XML layout file.
onAttach
Method called as soon as the fragment is attached to the father activity, used to store the reference about the activity.
onCreate
An important step where the fragment is in the creation process; it can be used to start threads to retrieve data from sources like a remote server.
onCreateView
The method called when the fragment creates its view hierarchy and the layout is inflated inside the fragment.
onActivityCreated
Method that notifies when the father activity is created and ready for use, meaning the activity is active and can be used.
onStart
Phase where the fragment is visible but is not yet interacting with the user.
onResume
Method called when the fragment is ready to interact with the user and is up and running.
onPause()
Lifecycle method for fragments that is similar to Activity.onPause().
onDestroyView()
Final fragment cleaning up method called if the OS decides to destroy the fragment view.
onDestroy()
Called when all active connections should be released because the fragment is close to shutting down.
onDetach
Method used to detach the fragment from the activity.
onStop()
Lifecycle method called when the fragment is no longer visible.
FragmentManager
A component in the Activity used to handle fragments, allowing them to be added, removed, replaced, or found at runtime.
Transaction
The operation required to activate any kind of manipulation (add, remove, replace) on a fragment through the FragmentManager.
Navigation
The interactions that allow users to navigate across, into, and back out from different pieces of content within an app.
Navigation graph
An XML resource file containing all navigation-related information, including destinations and the possible paths a user can take.
Destinations
The individual content areas within an app defined in the navigation graph.
NavHost
An empty container that displays destinations from the navigation graph.
NavHostFragment
The default NavHost implementation that displays fragment destinations.
NavController
An object that manages app navigation within a NavHost and orchestrates the swapping of destination content.