Can XML have a "double array", for example, does it have a "string array"? (Android)

I am trying to populate a counter with a drop down list of real numbers. The content is defined in Java, but in my spinners.xml the "double array" is rejected. Do I need to convert to String to use spinners?

 <string-array name="semester_spinner">
    <item>Spring</item>
    <item>Summer</item>
    <item>Fall</item>
    <item>Winter</item>
</string-array>

<double-array name="cred_spinner" />
+4
source share
1 answer

No, Android does not support a double array. It would be nice considering they already have a string array and an integer array.

, , Integer-Array? , , Typed-Array.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <array name="cred_spinner">
        <item>2.0</item>
        <item>3.0</item>
        <item>4.0</item>
        ...
     </array>
</resources>
+2

Source: https://habr.com/ru/post/1534704/


All Articles