Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Android Lifecycle Events

20

Flashcards

0/20

Still learning
StarStarStarStar

onActivityResult()

StarStarStarStar

Called when an activity you launched exits, giving you the requestCode you started it with, the resultCode it returned, and any additional data from it.

StarStarStarStar

onConfigurationChanged()

StarStarStarStar

Called by the system when the device configuration changes while your activity is running. This can occur for changes such as screen rotation, keyboard availability, or locale changes.

StarStarStarStar

onStop()

StarStarStarStar

Called when the activity is no longer visible to the user. This may occur because it is being destroyed, or because another activity has been resumed and is covering it.

StarStarStarStar

onSaveInstanceState()

StarStarStarStar

Called to retrieve per-instance state from an activity before being killed so that the state can be restored in onCreate() or onRestoreInstanceState()

StarStarStarStar

onTrimMemory()

StarStarStarStar

Called when the system needs to free up memory. There are different levels of trimming, ranging from the system just being polite, to the system about to kill your process.

StarStarStarStar

onRestoreInstanceState()

StarStarStarStar

Called so the activity can restore state from the information contained in the Bundle. Follows onStart() when the activity's instance state is being restored.

StarStarStarStar

onAttachedToWindow()

StarStarStarStar

Called when the view hierarchy of the activity is attached to the window. Can be used to do extra setup after your view hierarchy has been set up.

StarStarStarStar

onRestart()

StarStarStarStar

Called after the activity has been stopped, just prior to it being started again. Always followed by onStart()

StarStarStarStar

onStart()

StarStarStarStar

Called when the activity is becoming visible to the user. It's followed by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.

StarStarStarStar

onDetachedFromWindow()

StarStarStarStar

Called when the view hierarchy of the activity is detached from the window. Can be used to perform cleanup before the activity's views are removed.

StarStarStarStar

onBackPressed()

StarStarStarStar

Called when the activity has detected the user's press of the back key. The default implementation simply finishes the current activity, but it can be overridden to handle it differently.

StarStarStarStar

onWindowFocusChanged()

StarStarStarStar

Called when the current window of the activity gains or loses focus. This is often used for operations that require an update only when the user is looking at the activity.

StarStarStarStar

onCreate()

StarStarStarStar

Called when the activity is first created. This is where you should do all of your normal static set up: create views, bind data to lists, etc.

StarStarStarStar

onResume()

StarStarStarStar

Called when the activity will start interacting with the user. At this point, the activity is at the top of the activity stack, and captures all user input.

StarStarStarStar

onUserLeaveHint()

StarStarStarStar

Called when the user has pressed the home key. This is used by activities to ensure that there is a proper indication when the user is leaving the activity by their own choice.

StarStarStarStar

onDestroy()

StarStarStarStar

Called before the activity is destroyed. This is the final call that the activity will receive. It's usually implemented to ensure that all resources are released.

StarStarStarStar

onPause()

StarStarStarStar

Called when the system is about to start resuming another activity. It's used to commit unsaved changes to persistent data, stop animations, and other things that may be consuming CPU.

StarStarStarStar

onLowMemory()

StarStarStarStar

Called when the operating system has determined that it is in a low memory situation. You should clear caches and release unnecessary resources.

StarStarStarStar

onUserInteraction()

StarStarStarStar

Called whenever the user touches the screen in an activity. This is often used to reset any timers that would conclude the user has stopped interacting with the application.

StarStarStarStar

onRequestPermissionsResult()

StarStarStarStar

Called when the user responds to permission requests. This method is used to receive the result of those permission requests.

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.