문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top