Activity.OnResume Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called after onRestoreInstanceState(Bundle), onRestart(), or onPause().
[Android.Runtime.Register("onResume", "()V", "GetOnResumeHandler")]
protected virtual void OnResume();
[<Android.Runtime.Register("onResume", "()V", "GetOnResumeHandler")>]
abstract member OnResume : unit -> unit
override this.OnResume : unit -> unit
- Attributes
Remarks
Called after onRestoreInstanceState(Bundle), onRestart(), or onPause(). This is usually a hint for your activity to start interacting with the user, which is a good indicator that the activity became active and ready to receive input. This sometimes could also be a transit state toward another resting state. For instance, an activity may be relaunched to onPause() due to configuration changes and the activity was visible, but wasn't the top-most activity of an activity task. onResume() is guaranteed to be called before onPause() in this case which honors the activity lifecycle policy and the activity eventually rests in onPause(). On platform versions prior to Build.VERSION_CODES.Q this is also a good place to try to open exclusive-access devices or to get access to singleton resources. Starting with Build.VERSION_CODES.Q there can be multiple resumed activities in the system simultaneously, so onTopResumedActivityChanged(boolean) should be used for that purpose instead. Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.
See also:
Android reference for android.app.Activity.onResume.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.