Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top