Sub SetElevation(v As View, e As Float)
Dim jo As JavaObject
Dim p As Phone
If p.SdkVersion >= 21 Then
jo = v
jo.RunMethod("setElevation", Array As Object(e))
End If
End Sub
If you use minSdkVersion=21 in your app you can remeove the if/then which just checks if the app is running at least on API 21.