You should use the Picker class and not that API directly.
Native picker is only supported for some specific types of picker and only on physical Android/iOS devices. The Picker class seamlessly shows a Spinner instead when unavailable.
To check if the native picker is supported use Display.isNativePickerTypeSupported
.