if (pItems.size() > 0) { selectedIndex = index; ChoicePeer cp = (ChoicePeer) peer; if (cp != null) { cp.select(index); }
if( selectedIndex == index ) return;  selectedIndex = index; if( peer != null ) ((ChoicePeer)peer).select( index );
select(int index){  if ((index < 0) || (index >= getItemCount()))    throw new IllegalArgumentException("Bad index: " + index);  if (pItems.size() > 0) {      selectedIndex = index;      ChoicePeer cp = (ChoicePeer) peer;      if (cp != null) {          cp.select(index);      }  }}