OperatingSystem.IsAndroidVersionAtLeast(Int32, Int32, Int32, Int32) 方法

定義

檢查 Linux 命令 uname 所傳回的 Android 版本 () 是否大於或等於指定的版本。 這個方法可以用來保護在指定版本中新增的 API。

public static bool IsAndroidVersionAtLeast (int major, int minor = 0, int build = 0, int revision = 0);
static member IsAndroidVersionAtLeast : int * int * int * int -> bool
Public Shared Function IsAndroidVersionAtLeast (major As Integer, Optional minor As Integer = 0, Optional build As Integer = 0, Optional revision As Integer = 0) As Boolean

參數

major
Int32

主要版本號碼。

minor
Int32

次要版本號碼。

build
Int32

組建版本號碼。

revision
Int32

修訂版本號碼。

傳回

如果目前的應用程式是在 Android 上執行,且版本至少為參數中指定的值,則為 true;否則為 false

適用於