I am working on android project and I am looping through each control within a layout to add to an array, I am then passing this array to a function that will loop through the array and do some event based on the control. Is there a way that I can determine what the control type is. As psuedo code it would be something like this.
void getControlType(List<View> myControls)
{
foreach (List<View> control in myControls)
{
string controlType = getControlType(control);
if (controlType == "Button")
{
//do something on the button
}
}
}
While its not generally a good design pattern, this would work: