We can't find function for Spinner number line reading

53 views
Skip to first unread message

DogPlanner GSS

unread,
Jun 1, 2026, 5:18:39 AM (5 days ago) Jun 1
to DroidScript
Dear Developers,

We wish everyone a happy first day of summer! Hope that summer everyone will be able to relax wherever they want, lie down sunbathe and swim:))

Concerning DroidScript yesterday we tried to read spinner line value (as a number). In Internet there are several solutions of this issue but nothing work:

spinner.GetTextRaw() -> doesn't work
spinner.SetOnChange(function p_item)... -> reading the text of spinner line

At this moment we are reading the text (using .GetText method) of the current spinner line, and using string matching (with String.includes(...) method) to finding the array component of spinner list. Here we use for() cycle, and the program takes up several lines.

But may be is there a simplier option for this issue?

Thank you very much in advance.

have a nice day.

Best regards
Dmitry

Alan Hendry

unread,
Jun 1, 2026, 5:54:52 PM (4 days ago) Jun 1
to DroidScript
HI,
According to the docs the callback for spinner.SetOnChange
has (item,index).
spin = app.AddSpinner(lay,"Spinner [fa-html5],Frodo,Gandalf", 0.9 ,-1,fa);
spin.SetOnChange(function(item,index) {alert(item+" "+index);} )
Regards, ah

DogPlanner GSS

unread,
Jun 2, 2026, 10:01:33 AM (4 days ago) Jun 2
to DroidScript
Dear Alan,

Thank you, very much for answer! We found in internet info about callback function with p_item return answer only. Now we'll try to work with your function.

Have a nice day.

Best regards
Dmitry

вторник, 2 июня 2026 г. в 00:54:52 UTC+3, hendr...@gmail.com:

Alan Hendry

unread,
Jun 3, 2026, 12:04:26 PM (3 days ago) Jun 3
to DroidScript
HI,
The docs are available in the DS app  (top left icon) 
Choose English, then the DS version, 
Native > Controls > Create Spinner
Scroll down to SetOnChange, touch callback (in blue).
Regards, ah




DogPlanner GSS

unread,
Jun 4, 2026, 6:00:32 AM (2 days ago) Jun 4
to DroidScript
Dear Alan,

thank you very much! I always forget about the good internal DroidScript help, and try to find the information on the vastness of Internet. Often JavaScript info is come across, but it can be different from the DroidScript case.

Have a nice day.

Best regards
Dmitry

среда, 3 июня 2026 г. в 19:04:26 UTC+3, hendr...@gmail.com:
Reply all
Reply to author
Forward
0 new messages