Share via


ComponentName.UnflattenFromString(String) Method

Definition

Recover a ComponentName from a String that was previously created with #flattenToString().

[Android.Runtime.Register("unflattenFromString", "(Ljava/lang/String;)Landroid/content/ComponentName;", "")]
public static Android.Content.ComponentName? UnflattenFromString (string str);
[<Android.Runtime.Register("unflattenFromString", "(Ljava/lang/String;)Landroid/content/ComponentName;", "")>]
static member UnflattenFromString : string -> Android.Content.ComponentName

Parameters

str
String

The String that was returned by flattenToString().

Returns

Returns a new ComponentName containing the package and class names that were encoded in <var>str</var>

Attributes

Remarks

Recover a ComponentName from a String that was previously created with #flattenToString(). It splits the string at the first '/', taking the part before as the package name and the part after as the class name. As a special convenience (to use, for example, when parsing component names on the command line), if the '/' is immediately followed by a '.' then the final class name will be the concatenation of the package name with the string following the '/'. Thus "com.foo/.Blah" becomes package="com.foo" class="com.foo.Blah".

Java documentation for android.content.ComponentName.unflattenFromString(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

See also