Resources.GetFraction(Int32, Int32, Int32) Method

Definition

Retrieve a fractional unit for a particular resource ID.

[Android.Runtime.Register("getFraction", "(III)F", "GetGetFraction_IIIHandler")]
public virtual float GetFraction (int id, int base, int pbase);
[<Android.Runtime.Register("getFraction", "(III)F", "GetGetFraction_IIIHandler")>]
abstract member GetFraction : int * int * int -> single
override this.GetFraction : int * int * int -> single

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.

base
Int32

The base value of this fraction. In other words, a standard fraction is multiplied by this value.

pbase
Int32

The parent base value of this fraction. In other words, a parent fraction (nn%p) is multiplied by this value.

Returns

Attribute fractional value multiplied by the appropriate base value.

Attributes

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

Retrieve a fractional unit for a particular resource ID.

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