@Override
        public int getItemLayoutId(int position) {
            // use layout ids as types
            Object item = getItem(position);
            if (item instanceof City) {
                return R.layout.city_item;
            }
            if (item instanceof State) {
                return R.layout.state_item;
            }
            throw new IllegalArgumentException("unknown item type " + item);
        }
This is an example of an adapter that has a convention on its items where:
<ul>
<li> Each item type is represented with a different layout file
<li> Each layout file name their main object "data"
<li> Each layout file can receive extra parameters. This one only uses "callback".
</ul>
<p>
This kind of adapter usage might be very useful to simplify lists that have too many
different item types. Also, see the similarity between <code>city_item.xml</code> and
<code>state_item.xml</code>.
DataBindingDataBoundRecyclerView/app/src/main/java/com/example/android/databoundrecyclerview/MainActivity.java