且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找到匹配的标签,所有的纺纱厂

更新时间:2023-11-20 23:14:52

我认为你可以在其中previously增加了布局的所有孩子的微调并检查孩子是微调或没有。

I think you can get all the child of the layout in which you previously added the Spinner and check if the child is Spinner or not.

    LinearLayout ll = //Your Layout this can be any Linear or Relative layout 
                     //in which you added your spinners at runtime ;

    int count = ll.getChildCount();
    for(int i =0;i<count;i++)
    {
        View v = ll.getChildAt(i);
        if(v instanceof Spinner)
        {
            // you got the spinner
            Spinner s = (Spinner) v;
            Log.i("Item selected",s.getSelectedItem().toString());
        }
    }