Question: I have more than 100 spinners in my xml. Is there any way to find all spinners without using findViewById() to all the 100 spinners? It's tedious and I don't mean by some creation tools or something like that, I mean if there is a code to solve this problem. I need to connect each spinner to a string-array from my array.xml file.

Answer: 
```
Spinner spinner;
LinearLayout layout  = (LinearLayout) findViewById(R.id.layout_id);
for (int i =0 ;i <layout.getChildCount(); i++){
    if(layout.getChildAt(i) instanceof Spinner){
            spinner = (Spinner) layout.getChildAt(i);
    }
}

```

Where LinearLayout is yours main layout which contains spinners. You can add spinner to list or do with it whatever you want.
If your spinners aren't in the same ViewGroup, you'll have to do a full transversal like this:

```
public static List<Spinner> getAllSpinnersIn(ViewGroup view) {
    List<Spinner> list = new ArrayList<Spinner>();
    getAllSpinnersIn(view, list);
    return list;
}

private static void getAllSpinnersIn(ViewGroup view, List<Spinner> outList) {
    for (int i = 0, len = view.getChildCount(); i < len; i++) {
        View child = view.getChildAt(i);
        if (child instanceof ViewGroup) {
            getAllSpinnersIn((ViewGroup) child, outList);
        } else if (child instanceof Spinner) {
            outList.add((Spinner) child);
        }
    }
}

```