Share via


Resources.GetQuantityString Method

Definition

Overloads

GetQuantityString(Int32, Int32)

Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity.

GetQuantityString(Int32, Int32, Object[])

Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity.

GetQuantityString(Int32, Int32)

Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity.

[Android.Runtime.Register("getQuantityString", "(II)Ljava/lang/String;", "GetGetQuantityString_IIHandler")]
public virtual string GetQuantityString (int id, int quantity);
[<Android.Runtime.Register("getQuantityString", "(II)Ljava/lang/String;", "GetGetQuantityString_IIHandler")>]
abstract member GetQuantityString : int * int -> string
override this.GetQuantityString : int * int -> string

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.

quantity
Int32

The number used to get the correct string for the current language's plural rules.

Returns

String The string data associated with the resource, stripped of styled text information.

Attributes

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity. Note that the string is selected based solely on grammatical necessity, and that such rules differ between languages. Do not assume you know which string will be returned for a given quantity. See String Resources for more detail.

Java documentation for android.content.res.Resources.getQuantityString(int, 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

GetQuantityString(Int32, Int32, Object[])

Returns the string necessary for grammatically correct pluralization of the given resource ID for the given quantity.

[Android.Runtime.Register("getQuantityString", "(II[Ljava/lang/Object;)Ljava/lang/String;", "GetGetQuantityString_IIarrayLjava_lang_Object_Handler")]
public virtual string GetQuantityString (int id, int quantity, params Java.Lang.Object[]? formatArgs);
[<Android.Runtime.Register("getQuantityString", "(II[Ljava/lang/Object;)Ljava/lang/String;", "GetGetQuantityString_IIarrayLjava_lang_Object_Handler")>]
abstract member GetQuantityString : int * int * Java.Lang.Object[] -> string
override this.GetQuantityString : int * int * Java.Lang.Object[] -> string

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.

quantity
Int32

The number used to get the correct string for the current language's plural rules.

formatArgs
Object[]

Returns

String The string data associated with the resource, stripped of styled text information.

Attributes

Remarks

Java documentation for android.content.res.Resources.getQuantityString(int, 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