Android get type of a view

Solution 1:

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 ...

Solution 2:

I try the following and it worked:

View view=FLall.getChildAt(i);
Log.i("ViewName", view.getClass().getName());