public void onItemChanged(int itemId){
  if (mBlockUpdates || mPresenter == null)   return;
  int oldPos=getAdapterPosForId(itemId);
  prepareMenuItems();
  int newPos=getAdapterPosForId(itemId);
  if (oldPos == -1 && newPos == -1) {
    return;
  }
  if (oldPos == -1) {
    mPresenter.reportChange(new Change(Change.ChangeType.ITEM_INSERTED,newPos,-1,-1,-1),mAdapterData);
  }
 else   if (newPos == -1) {
    mPresenter.reportChange(new Change(Change.ChangeType.ITEM_REMOVED,oldPos,-1,-1,-1),mAdapterData);
  }
 else   if (oldPos == newPos) {
    mPresenter.reportChange(new Change(Change.ChangeType.ITEM_CHANGED,newPos,-1,-1,-1),mAdapterData);
  }
 else {
    mPresenter.reportChange(new Change(Change.ChangeType.ITEM_MOVED,-1,oldPos,newPos,-1),mAdapterData);
  }
}

public void onItemChanged ( int itemId ) { if ( mBlockUpdates || mPresenter == null ) return ; int oldPos = getAdapterPosForId ( itemId ) ; prepareMenuItems ( ) ; int newPos = getAdapterPosForId ( itemId ) ; if ( oldPos == - 1 && newPos == - 1 ) { return ; } if ( oldPos == - 1 ) { mPresenter . reportChange ( new Change ( Change . ChangeType . ITEM_INSERTED , newPos , - 1 , - 1 , - 1 ) , mAdapterData ) ; } else if ( newPos == - 1 ) { mPresenter . reportChange ( new Change ( Change . ChangeType . ITEM_REMOVED , oldPos , - 1 , - 1 , - 1 ) , mAdapterData ) ; } else if ( oldPos == newPos ) { mPresenter . reportChange ( new Change ( Change . ChangeType . ITEM_CHANGED , newPos , - 1 , - 1 , - 1 ) , mAdapterData ) ; } else { mPresenter . reportChange ( new Change ( Change . ChangeType . ITEM_MOVED , - 1 , oldPos , newPos , - 1 ) , mAdapterData ) ; } }
called when an item is changed . type of change is evaluated by comparing the ' old ' position & amp ; the ' new ' position of the item .
