Share via


SettingInjectorService.OnStartCommand Method

Definition

Called by the system every time a client explicitly starts the service by calling StartService(Intent), providing the arguments it supplied and a unique integer token representing the start request.

[Android.Runtime.Register("onStartCommand", "(Landroid/content/Intent;II)I", "")]
public override sealed Android.App.StartCommandResult OnStartCommand (Android.Content.Intent? intent, Android.App.StartCommandFlags flags, int startId);
[<Android.Runtime.Register("onStartCommand", "(Landroid/content/Intent;II)I", "")>]
override this.OnStartCommand : Android.Content.Intent * Android.App.StartCommandFlags * int -> Android.App.StartCommandResult

Parameters

intent
Intent

The Intent supplied to StartService(Intent), as given. This may be null if the service is being restarted after its process has gone away, and it had previously returned anything except Android.App.Service.START_STICKY_COMPATIBILITY.

flags
StartCommandFlags

Additional data about this start request. Currently either 0, Android.App.Service.START_FLAG_REDELIVERY, or Android.App.Service.START_FLAG_RETRY.

startId
Int32

A unique integer representing this specific request to start. Use with StopSelfResult(Int32).

Returns

Attributes

Remarks

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