简体   繁体   中英

how to set boolean value in spinner android?

I am getting boolean value from the server how to set that value to the spinner and retrieve and send it back to server?

               if (true) {
                    spinner.setSelection(1);
                } else {
                    spinner.setSelection(2);
                }

how to retrieve the value from the spinner and how to send boolean value to the server, is there any easiest way?

As per chirag's comment, you can covert that boolean to index (because you know the value of boolean on the index) and you can covert and sent it to the server.

You can follow the In MultiSelectionSpinner Class:

https://www.woolha.com/tutorials/android-multi-select-spinner-example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM