Compartilhar via


Activity.OnStart Method

Definition

Called after #onCreate — or after #onRestart when the activity had been stopped, but is now again being displayed to the user.

[Android.Runtime.Register("onStart", "()V", "GetOnStartHandler")]
protected virtual void OnStart ();
[<Android.Runtime.Register("onStart", "()V", "GetOnStartHandler")>]
abstract member OnStart : unit -> unit
override this.OnStart : unit -> unit
Attributes

Remarks

Called after #onCreate &mdash; or after #onRestart when the activity had been stopped, but is now again being displayed to the user. It will usually be followed by #onResume. This is a good place to begin drawing visual elements, running animations, etc.

You can call #finish from within this function, in which case #onStop will be immediately called after #onStart without the lifecycle transitions in-between (#onResume, #onPause, etc) executing.

<em>Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.</em>

Java documentation for android.app.Activity.onStart().

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.

Applies to

See also