0

Given a View object which has already been inflated by a layout, how can I retrieve the kind of layout it had been inflated yet? I want to check something like this:

convertView.getLayoutId() == R.layout.my_layout

If this does not work, do you think one possible way of tracking this is to do as follows:

convertView = inflater.inflate(getLayout(), null);
convertView.setTag(getLayout());

?

Mahoni
  • 7,088
  • 17
  • 58
  • 115

1 Answers1

4

That information is not recorded by the View system. If you want to track that, you will have to do so yourself. You could use setTag() and getTag(), for example.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491