If, for some strange reason, you can't use Asahi's suggestion (using tags), my proposition would be the following:
if (view instanceof ImageView) {
ImageView imageView = (ImageView) view;
// do what you want with imageView
}
else if (view instanceof TextView) {
TextView textView = (TextView) view;
// do what you want with textView
}
else if ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…