AsyncTask.DoInBackground(Object[]) Method

Definition

Override this method to perform a computation on a background thread.

[Android.Runtime.Register("doInBackground", "([Ljava/lang/Object;)Ljava/lang/Object;", "GetDoInBackground_arrayLjava_lang_Object_Handler")]
protected abstract Java.Lang.Object? DoInBackground (params Java.Lang.Object[]? params);
[<Android.Runtime.Register("doInBackground", "([Ljava/lang/Object;)Ljava/lang/Object;", "GetDoInBackground_arrayLjava_lang_Object_Handler")>]
abstract member DoInBackground : Java.Lang.Object[] -> Java.Lang.Object

Parameters

params
Object[]

The parameters of the task.

Returns

A result, defined by the subclass of this task.

Attributes

Remarks

Override this method to perform a computation on a background thread. The specified parameters are the parameters passed to #execute by the caller of this task.

This will normally run on a background thread. But to better support testing frameworks, it is recommended that this also tolerates direct execution on the foreground thread, as part of the #execute call.

This method can call #publishProgress to publish updates on the UI thread.

Java documentation for android.os.AsyncTask.doInBackground(Params...).

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