更新时间: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());
}
}