Buggy code:
public class NavigationDrawerFragment extends BaseFragment implements ViewPager . OnPageChangeListener , View . OnClickListener { public static final String TAG = NavigationDrawerFragment . class . getName ( ) ; private static final int INDEX_SOUND_SHEETS = 0 ; private static final int INDEX_PLAYLIST = 1 ; private ViewPager tabContent ; private NavigationDrawerFragment . TabContentAdapter tabContentAdapter ; private SoundLayoutList soundLayoutList ; private SoundLayoutListAdapter soundLayoutListAdapter ; private Playlist playlist ; private PlaylistAdapter playlistAdapter ; private SoundSheets soundSheets ; private SoundSheetsAdapter soundSheetsAdapter ; private View contextualActionContainer ; private View deleteSelected ; public Playlist getPlaylist ( ) { } public SoundSheetsAdapter getSoundSheetsAdapter ( ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } private void initSoundLayoutsAndAdapter ( ) { } private void initSoundSheetsAndAdapter ( ) { } private void initPlayListAndAdapter ( ) { } @ Override public void onPause ( ) { } @ Override public void onClick ( View v ) { int id = v . getId ( ) ; if ( id == ( id . b_delete ) ) { if ( ( this . tabContent . getCurrentItem ( ) ) == ( NavigationDrawerFragment . INDEX_PLAYLIST ) ) this . playlist . prepareItemDeletion ( ) ; else this . soundSheets . prepareItemDeletion ( ) ; } else if ( id == ( id . b_delete_selected ) ) { if ( ( this . tabContent . getCurrentItem ( ) ) == ( NavigationDrawerFragment . INDEX_PLAYLIST ) ) this . playlist . deleteSelected ( ) ; else this . soundSheets . deleteSelected ( ) ; } else if ( id == ( id . b_add ) ) { if ( ( this . tabContent . getCurrentItem ( ) ) == ( NavigationDrawerFragment . INDEX_PLAYLIST ) ) AddNewSoundDialog . showInstance ( this . getFragmentManager ( ) , Playlist . TAG ) ; else { SoundSheetsManagerFragment fragment = this . getSoundSheetManagerFragment ( ) ; AddNewSoundSheetDialog . showInstance ( this . getFragmentManager ( ) , fragment . getSuggestedSoundSheetName ( ) ) ; } } else if ( id == ( id . layout_change_sound_layout ) ) { View indicator = this . getActivity ( ) . findViewById ( iv_change_sound_layout_indicator ) ; indicator . animate ( ) . rotationXBy ( 180 ) . setDuration ( this . getResources ( ) . getInteger ( config_shortAnimTime ) ) . start ( ) ; this . soundLayoutList . toggleVisibility ( ) ; <START_BUG> if ( ( ! ( this . getBaseActivity ( ) . isActionModeActive ( ) ) ) && ( ( this . soundLayoutList . getVisibility ( ) ) == ( View . VISIBLE ) ) ) <END_BUG> this . soundLayoutList . prepareItemDeletion ( ) ; } } public void onActionModeStart ( ) { } public void onActionModeFinished ( ) { } @ Override public void onPageScrolled ( int position , float positionOffset , int positionOffsetPixels ) { } @ Override public void onPageSelected ( int position ) { } @ Override public void onPageScrollStateChanged ( int state ) { } private class TabContentAdapter extends PagerAdapter { @ Override public CharSequence getPageTitle ( int position ) { } @ Override public int getCount ( ) { } @ Override public boolean isViewFromObject ( View view , Object object ) { } @ Override public Object instantiateItem ( ViewGroup container , int position ) { } } private void adjustViewPagerToContent ( ) { } private class ViewPagerContentObserver extends RecyclerView . AdapterDataObserver { @ Override public void onChanged ( ) { } } }

Fix:
if ( ( this . getBaseActivity ( ) . isActionModeActive ( ) ) && ( this . soundLayoutList . isActive ( ) ) )