Share via


ComponentName.CreateRelative Method

Definition

Overloads

CreateRelative(Context, String)

Create a new component identifier where the class name may be specified as either absolute or relative to the containing package.

CreateRelative(String, String)

Create a new component identifier where the class name may be specified as either absolute or relative to the containing package.

CreateRelative(Context, String)

Create a new component identifier where the class name may be specified as either absolute or relative to the containing package.

[Android.Runtime.Register("createRelative", "(Landroid/content/Context;Ljava/lang/String;)Landroid/content/ComponentName;", "", ApiSince=23)]
public static Android.Content.ComponentName CreateRelative (Android.Content.Context pkg, string cls);
[<Android.Runtime.Register("createRelative", "(Landroid/content/Context;Ljava/lang/String;)Landroid/content/ComponentName;", "", ApiSince=23)>]
static member CreateRelative : Android.Content.Context * string -> Android.Content.ComponentName

Parameters

pkg
Context

a Context for the package implementing the component

cls
String

the name of the class inside of <var>pkg</var> that implements the component

Returns

the new ComponentName

Attributes

Remarks

Create a new component identifier where the class name may be specified as either absolute or relative to the containing package.

Relative package names begin with a '.' character. For a package "com.example" and class name ".app.MyActivity" this method will return a ComponentName with the package "com.example"and class name "com.example.app.MyActivity". Fully qualified class names are also permitted.

Java documentation for android.content.ComponentName.createRelative(android.content.Context, java.lang.String).

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

CreateRelative(String, String)

Create a new component identifier where the class name may be specified as either absolute or relative to the containing package.

[Android.Runtime.Register("createRelative", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/ComponentName;", "", ApiSince=23)]
public static Android.Content.ComponentName CreateRelative (string pkg, string cls);
[<Android.Runtime.Register("createRelative", "(Ljava/lang/String;Ljava/lang/String;)Landroid/content/ComponentName;", "", ApiSince=23)>]
static member CreateRelative : string * string -> Android.Content.ComponentName

Parameters

pkg
String

the name of the package the component exists in

cls
String

the name of the class inside of <var>pkg</var> that implements the component

Returns

the new ComponentName

Attributes

Remarks

Create a new component identifier where the class name may be specified as either absolute or relative to the containing package.

Relative package names begin with a '.' character. For a package "com.example" and class name ".app.MyActivity" this method will return a ComponentName with the package "com.example"and class name "com.example.app.MyActivity". Fully qualified class names are also permitted.

Java documentation for android.content.ComponentName.createRelative(java.lang.String, java.lang.String).

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