Resources.GetTextFormatted Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetTextFormatted(Int32) |
Return the string value associated with a particular resource ID. |
GetTextFormatted(Int32, ICharSequence) |
Return the string value associated with a particular resource ID. |
GetTextFormatted(Int32)
Return the string value associated with a particular resource ID.
[Android.Runtime.Register("getText", "(I)Ljava/lang/CharSequence;", "GetGetText_IHandler")]
public virtual Java.Lang.ICharSequence GetTextFormatted (int id);
[<Android.Runtime.Register("getText", "(I)Ljava/lang/CharSequence;", "GetGetText_IHandler")>]
abstract member GetTextFormatted : int -> Java.Lang.ICharSequence
override this.GetTextFormatted : int -> Java.Lang.ICharSequence
Parameters
- id
- Int32
The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.
Returns
CharSequence The string data associated with the resource, plus possibly styled text information.
- Attributes
Exceptions
Throws NotFoundException if the given ID does not exist.
Remarks
Return the string value associated with a particular resource ID. The returned object will be a String if this is a plain string; it will be some other type of CharSequence if it is styled. {
Java documentation for android.content.res.Resources.getText(int)
.
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
GetTextFormatted(Int32, ICharSequence)
Return the string value associated with a particular resource ID.
[Android.Runtime.Register("getText", "(ILjava/lang/CharSequence;)Ljava/lang/CharSequence;", "GetGetText_ILjava_lang_CharSequence_Handler")]
public virtual Java.Lang.ICharSequence? GetTextFormatted (int id, Java.Lang.ICharSequence? def);
[<Android.Runtime.Register("getText", "(ILjava/lang/CharSequence;)Ljava/lang/CharSequence;", "GetGetText_ILjava_lang_CharSequence_Handler")>]
abstract member GetTextFormatted : int * Java.Lang.ICharSequence -> Java.Lang.ICharSequence
override this.GetTextFormatted : int * Java.Lang.ICharSequence -> Java.Lang.ICharSequence
Parameters
- id
- Int32
The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.
- def
- ICharSequence
The default CharSequence to return.
Returns
CharSequence The string data associated with the resource, plus possibly styled text information, or def if id is 0 or not found.
- Attributes
Remarks
Return the string value associated with a particular resource ID. The returned object will be a String if this is a plain string; it will be some other type of CharSequence if it is styled.
Java documentation for android.content.res.Resources.getText(int, java.lang.CharSequence)
.
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.