Android – Image resource ids in one array. How to use?

    <array name="sun_drawable_list">
        <item>@drawable/sun_0</item>
        <item>@drawable/sun_1</item>
        <item>@drawable/sun_2</item>
        <item>@drawable/sun_3</item>
        <item>@drawable/sun_4</item>
        <item>@drawable/sun_5</item>
        <item>@drawable/sun_6</item>
        <item>@drawable/sun_7</item>
        <item>@drawable/sun_8</item>
    </array>

values/strings.xml

        TypedArray sun_drawable_list = context.getResources()
                .obtainTypedArray(R.array.sun_drawable_list);

        ivSun.setImageResource(sun_drawable_list.getResourceId(0, -1));

ImageView ivSun will be set to this drawable: @drawable/sun_0