Intent.SetClass Method

Definition

Overloads

Name Description
SetClass(Context, Class)

Convenience for calling #setComponent(ComponentName) with the name returned by a Class object.

SetClass(Context, Type)

Convenience for calling setComponent(ComponentName) with the name returned by a Class object.

SetClass(Context, Class)

Convenience for calling #setComponent(ComponentName) with the name returned by a Class object.

[Android.Runtime.Register("setClass", "(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;", "GetSetClass_Landroid_content_Context_Ljava_lang_Class_Handler")]
public virtual Android.Content.Intent SetClass(Android.Content.Context packageContext, Java.Lang.Class cls);
[<Android.Runtime.Register("setClass", "(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;", "GetSetClass_Landroid_content_Context_Ljava_lang_Class_Handler")>]
abstract member SetClass : Android.Content.Context * Java.Lang.Class -> Android.Content.Intent
override this.SetClass : Android.Content.Context * Java.Lang.Class -> Android.Content.Intent

Parameters

packageContext
Context

A Context of the application package implementing this class.

cls
Class

The class name to set, equivalent to setClassName(context, cls.getName()).

Returns

Returns the same Intent object, for chaining multiple calls into a single statement.

Attributes

Remarks

Convenience for calling #setComponent(ComponentName) with the name returned by a Class object.

Java documentation for android.content.Intent.setClass(android.content.Context, java.lang.Class<?>).

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

SetClass(Context, Type)

Convenience for calling setComponent(ComponentName) with the name returned by a Class object.

public Android.Content.Intent SetClass(Android.Content.Context packageContext, Type type);
member this.SetClass : Android.Content.Context * Type -> Android.Content.Intent

Parameters

packageContext
Context

A Context of the application package implementing this class. This value cannot be null .

type
Type

The class name to set, equivalent to setClassName(context, cls.getName()) . This value cannot be null .

Returns

Returns the same Intent object, for chaining multiple calls into a single statement. This value cannot be null .

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.

Java documentation for android.content.Intent.setClass(android.content.Context, java.lang.Class<?>).

Applies to