Question

I have searched for simple examples of using a picker without any luck.

I would like to have my picker pull from a set of strings for the user to choose from, but I can not seem to even get the following to display.

Long now = new Date().getTime();
Date date = (Date) Display.getInstance().showNativePicker(Display.PICKER_TYPE_DATE, cal, now, null);

edit : added code block

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top