This is a collection of visual guides that I find myself coming back to repeatedly while doing Android development. Open to contributions!
| Callback | When | What | Is Activity visible |
|---|---|---|---|
| onCreate() | Activity is first created | All the necessary UI elements should be initialized | no |
| onStart() | Activity becomes visible to user | Code that maintains the UI, start async tasks (get data from API or database), register listeners | yes |
| onResume() | Activity becomes interactable to user | Starts animations | yes |
| onPause() | User is leaving the activity | Stops animations | partially visible |
| onStop() | Activity is no longer visible to user | Unregisters listeners and resources allocated in onStart() | no |
| onRestart() | Activity in the stopped state is about to start again (on back click) | Cursor objects should be re-queried | no |
| onDestroy() | Activity is destroyed from memory | no |
| Mode | Default | Instantiation | New Task on Launch | Allow other activities within Task |
|---|---|---|---|---|
| standard | Yes | Everytime an intent is created, a new instance is created. Also instances can be member of multiple tasks and more than one instance in a Task. | No. Open in the same Task that originated the intent | Yes |
| singleTop | No | Exactly like standard but if the activity is at the top of the Task stack then it uses the existing instance. | No. Open in the same Task that originated the intent | Yes |
| singleTask | No | Single instance | Yes. Always a Root Task. | Yes |
| singleInstance | No | Single instance | Yes. Always a Root Task. | Never. Always the only activity in the task |
| Piece | What it does |
|---|---|
RecyclerView |
The ViewGroup that contains the views corresponding to your data. |
| item | One data item of the list to display. Can be of any type; often a data class you define. |
Adapter |
Takes data and prepares it for RecyclerView to display. |
ViewHolders |
A pool of views for RecyclerView to use and reuse to display items. Each individual ViewHolder is a wrapper around a View. |
View |
A layout that can display one data item. |
LayoutManager |
Measures and positions individual item views within a RecyclerView and determines the policy for when to recycle item views that are no longer visible. The ones provided in the RecyclerView library are LinearLayoutManager, GridLayoutManager, and StaggeredGridLayoutManager |















