public static int getPositionByIdentifier ( DrawerBuilder drawer , long identifier ) { if ( identifier != - 1 ) { for ( int i = 0 ; i < drawer . getAdapter ( ) . getItemCount ( ) ; i ++ ) { if ( drawer . getAdapter ( ) . getItem ( i ) . getIdentifier ( ) == identifier ) { return i ; } } } return - 1 ; }
calculates the position of an drawerItem . searching by it s identifier