Share via


SdkExtensions.GetExtensionVersion(Int32) Method

Definition

Return the version of the specified extensions.

[Android.Runtime.Register("getExtensionVersion", "(I)I", "", ApiSince=33)]
public static int GetExtensionVersion (int extension);
[<Android.Runtime.Register("getExtensionVersion", "(I)I", "", ApiSince=33)>]
static member GetExtensionVersion : int -> int

Parameters

extension
Int32

the extension to get the version of.

Returns

Attributes

Remarks

Return the version of the specified extensions.

This method is suitable to use in conditional statements to determine whether an API is available and is safe to use. For example:

if (getExtensionVersion(VERSION_CODES.R) >= 3) {
              // Safely use API available since R extensions version 3
            }

Java documentation for android.os.ext.SdkExtensions.getExtensionVersion(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