Code example for Adapter

Methods: getView

0
            addViewInLayout(child, (addToEnd ? -1 : 0), p, true);
        return child;
    } 
 
    private View makeAndAddView(int position, boolean addToEnd, View convertView) {
        View view = mAdapter.getView(position, convertView, this);
        return setupChild(view, addToEnd, convertView != null);
    } 
 
    class AdapterDataSetObserver extends DataSetObserver {
 
        @Override 
        public void onChanged() { 
            View v = getChildAt(mCurrentBufferIndex);
            if (v != null) {
                for (int index = 0; index < mAdapter.getCount(); index++) {
                    if (v.equals(mAdapter.getItem(index))) {
                        mCurrentAdapterIndex = index;
                        break; 
                    } 
                }