String picker question

16 views
Skip to first unread message

Hannah R

unread,
Jan 15, 2021, 12:31:12 PM1/15/21
to CodenameOne Discussions
Hi,

I noticed when I use com.codename1.ui.spinner.Picker for type PICKER_TYPE_STRINGS, if I set Strings as not a hardcoded Strings but as String[ ], I get
java.lang.NullPointerException while spinning the Picker.
I get it only if I also do setSelectedString(). If there is a setSelectedStringIndex(), no error occurs. 

I wondered, why would it happen?

Shai Almog

unread,
Jan 16, 2021, 1:38:42 AM1/16/21
to CodenameOne Discussions
Hi,
do you have a stack trace?
On which OS is this happening? Does it happen on the simulator?
Is it possible one of the elements in the array is null?

Hannah R

unread,
Jan 17, 2021, 2:21:12 PM1/17/21
to CodenameOne Discussions

Sorry, you are right. One of the elements was null. 
Reply all
Reply to author
Forward
0 new messages