Use instanceof
to check View is Button or other View before applying background color as:
for(int x=0;x<accordionMenu.getChildCount();x++){
View view = accordionMenu.getChildAt(i);
if (view instanceof Button) {
view.setBackground(accordStyle);
}
}